home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-ietf-imap-imap2bis-00.txt < prev    next >
Text File  |  1993-08-16  |  97KB  |  2,580 lines

  1.  
  2.  
  3.  
  4. Network Working Group                                       Mark Crispin
  5. Internet Draft: IMAP2bis                        University of Washington
  6. Obsoletes: RFC 1176, 1064                                    August 1993
  7.  
  8.  
  9.             INTERACTIVE MAIL ACCESS PROTOCOL - VERSION 2bis
  10.  
  11.  
  12. Status of this Memo
  13.  
  14.    This document is an Internet Draft.  Internet Drafts are working
  15.    documents of the Internet Engineering Task Force (IETF), its Areas,
  16.    and its Working Groups. Note that other groups may also distribute
  17.    working documents as Internet Drafts.
  18.  
  19.    Internet Drafts are draft documents valid for a maximum of six
  20.    months.  Internet Drafts may be updated, replaced, or obsoleted by
  21.    other documents at any time.  It is not appropriate to use Internet
  22.    Drafts as reference material or to cite them other than as a "working
  23.    draft" or "work in progress."  Please check the I-D abstract listing
  24.    contained in each Internet Draft directory to learn the current
  25.    status of any this or any other Internet Draft.
  26.  
  27.    This draft document will be submitted to the RFC editor as a Proposed
  28.    Standard for the Internet Community.  Discussion and suggestions for
  29.    improvement are requested.  This document will expire before 31
  30.    December 1993.  Distribution of this draft is unlimited.  Comments
  31.    are solicited and should be sent to imap@CAC.Washington.EDU.
  32.  
  33.  
  34. Introduction
  35.  
  36.    The Interactive Mail Access Protocol, Version 2bis (IMAP2bis) allows
  37.    a client to access and manipulate electronic mail on a server.
  38.    IMAP2bis is designed to permit manipulations of remote mailboxes as
  39.    if they were local.  IMAP2bis includes operations for creating,
  40.    deleting, and renaming mailbox folders; checking for new mail;
  41.    permanently removing messages; setting and clearing flags; RFC 822
  42.    and MIME parsing; searching; and selective fetching of message
  43.    attributes, texts, and portions thereof.
  44.  
  45.    IMAP2bis does not specify a means of posting mail; this function is
  46.    handled by a mail transfer protocol such as SMTP (RFC 821).
  47.  
  48.    IMAP2bis assumes a reliable data stream such as provided by TCP.
  49.    When TCP is used, an IMAP2bis server listens on port 143.
  50.  
  51.  
  52.  
  53.  
  54.  
  55. Crispin                                                         [Page 1]
  56.  
  57. Internet Draft                  IMAP2bis                 August 13, 1993
  58.  
  59.  
  60. System Model and Philosophy
  61.  
  62.    There are three fundamental models of client/server email: offline,
  63.    online, and disconnected use.  IMAP2bis can be used in any one of
  64.    these three models.
  65.  
  66.    The offline model is the most familiar form of client/server email
  67.    today, and is used by protocols such as POP-3 (RFC 1225) and UUCP.
  68.    In this model, a client application periodically connects to a
  69.    server.  It downloads all of the pending messages to the client
  70.    machine and deletes these from the server.  Thereafter, all mail
  71.    processing is local to the client.  This model is store-and-forward;
  72.    it moves mail on demand from an intermediate server (maildrop) to a
  73.    single destination machine.
  74.  
  75.    The online model is most commonly used with remote filesystem
  76.    protocols such as NFS.  In this model, a client application
  77.    manipulates mailbox data on a server machine.  A connection to the
  78.    server is maintained throughout the entire session.  No mailbox data
  79.    is kept on the client; the client retrieves data from the server as
  80.    is needed.  IMAP2bis introduces a form of the online model which
  81.    requires considerably less network bandwidth than a remote filesystem
  82.    protocol, and provides the opportunity for using the server for CPU
  83.    or I/O intensive functions such as parsing and searching.
  84.  
  85.    The disconnected use model is a hybrid of the offline and online
  86.    models, and is used by protocols such as PCMAIL (RFC 1056).  In this
  87.    model, a client user downloads some set of messages from the server,
  88.    manipulates them offline, then at some later time uploads the
  89.    changes.  The server remains the authoritative repository of the
  90.    messages.  The problems of synchronization (particularly when
  91.    multiple clients are involved) are handled through the means of
  92.    unique identifiers for each message.
  93.  
  94.    Each of these models have their own strengths and weaknesses, as
  95.    shown in the following table:
  96.  
  97.       Feature                               Offline Online  Disc
  98.       -------                               ------- ------  ----
  99.       Can use multiple clients               NO      YES     YES
  100.       Minimum use of server connect time     YES     NO      YES
  101.       Minimum use of server resources        YES     NO      NO
  102.       Minimum use of client disk resources   NO      YES     NO
  103.       Multiple remote mailboxes              NO      YES     YES
  104.       Fast startup                           NO      YES     NO
  105.       Mail processing when not online        YES     NO      YES
  106.  
  107.    Although IMAP2bis was originally designed to accommodate the online
  108.  
  109.  
  110.  
  111. Crispin                                                         [Page 2]
  112.  
  113. Internet Draft                  IMAP2bis                 August 13, 1993
  114.  
  115.  
  116.    model, it can support the other two models as well.  This makes
  117.    possible the creation of clients which can be used in any of the
  118.    three models.  For example, a user may wish to switch between the
  119.    online and disconnected models on a regular basis (e.g. due to
  120.    travel).
  121.  
  122.    IMAP2bis is designed to transmit message data on demand, and to
  123.    provide the facilities necessary for a client to make an intelligent
  124.    decision on what data it needs at any particular time.  There is
  125.    generally no need to do a wholesale transfer of an entire mailbox or
  126.    even of the complete text of a message.  This makes a difference in
  127.    situations where the mailbox is large, or when the link to the server
  128.    is slow.
  129.  
  130.    More specifically, IMAP2bis provides the capability of server-based
  131.    RFC 822 and MIME processing.  With this information, it is possible
  132.    for a client to determine in advance whether or not it wishes to
  133.    retrieve a particular message or part of a message.  For example, a
  134.    user connected to an IMAP2bis server via a dialup link can determine
  135.    that a message has a 2000 byte text segment and a 40 megabyte video
  136.    segment, and elect to fetch only the text segment.
  137.  
  138.    In IMAP2bis, the client/server relationship lasts only for the
  139.    duration of the TCP connection, and mailbox state is maintained on
  140.    the server.  There is no registration of clients.  With the possible
  141.    exception of unique identifiers used in disconnected use operation,
  142.    the client initially has no knowledge of mailbox state and learns it
  143.    from the IMAP2bis server when a mailbox is selected.  This initial
  144.    transfer is minimal; the client requests additional state data as it
  145.    needs it.
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167. Crispin                                                         [Page 3]
  168.  
  169. Internet Draft                  IMAP2bis                 August 13, 1993
  170.  
  171.  
  172. The Protocol
  173.  
  174.    The IMAP2bis protocol consists of a sequence of client commands and
  175.    server responses, with server data interspersed between the
  176.    responses.  Unlike most Internet protocols, commands and responses
  177.    are tagged.  That is, a command begins with a unique identifier
  178.    (typically a short alphanumeric sequence such as a Lisp "gensym"
  179.    function would generate e.g., A0001, A0002, etc.) called a tag.  The
  180.    response to the command is given the same tag from the server.
  181.  
  182.    Additionally, the server may send an arbitrary amount of "unsolicited
  183.    data", which is identified by the special reserved tag of "*".  The
  184.    unsolicited data mechanism is used to transmit most data in IMAP2bis.
  185.    The term "unsolicited data" refers to the fact that the data may have
  186.    been transmitted without any explicit request by the client for that
  187.    data.  No distinction is made in IMAP2bis between data transmitted as
  188.    a result of a client command and data which is unilaterally
  189.    transmitted by the server.  One form of unilaterally transmitted data
  190.    which commonly occurs is an alert of a change to the mailbox made by
  191.    some process other than the IMAP2bis client or server; for example,
  192.    changes in the size of the mailbox (new mail) or in the status of
  193.    individual messages.
  194.  
  195.    There is another special reserved tag, "+", discussed below.
  196.  
  197.    The server must be listening for a connection.  When a connection is
  198.    opened the server sends a greeting message and then waits for
  199.    commands.  This greeting is either a PREAUTH (meaning that the user
  200.    has already been identified and authenticated by an external
  201.    mechanism such as rsh) or OK (meaning that the user is not yet
  202.    authenticated) unsolicited response.  The server may also send a BYE
  203.    unsolicited response and close the connection if it rejects the
  204.    connection.
  205.  
  206.    The client opens a connection and waits for the greeting.  The client
  207.    must not send any commands until it has received the greeting from
  208.    the server.
  209.  
  210.    Once the greeting has been received, the client may begin sending
  211.    commands.  It is not under any obligation to wait for a server
  212.    response to a command before sending another command, subject to the
  213.    constraints of underlying flow control.  When commands are received
  214.    the server acts on them and responds with command responses, often
  215.    interspersed with data.
  216.  
  217.    In general, the command responses do not themselves contain the
  218.    requested data, but rather indicate the completion status of the
  219.    request.  There are three fundamental responses: success (OK), error
  220.  
  221.  
  222.  
  223. Crispin                                                         [Page 4]
  224.  
  225. Internet Draft                  IMAP2bis                 August 13, 1993
  226.  
  227.  
  228.    (NO), request faulty or not understood (BAD).  The effect of a
  229.    command can not be considered complete until a command response with
  230.    a tag matching the command is received from the server.
  231.  
  232.    It is not required that a server process a command to completion
  233.    before beginning processing of the next command, except when the
  234.    processing of the previous command may affect the results of the next
  235.    command by changing the state of the current mailbox.  This has
  236.    certain other effects; for example, this implies that an EXPUNGE
  237.    response can not be transmitted as part of a response to a request
  238.    that may be streamed with another response.
  239.  
  240.    If authentication has not yet been completed, it must now be done via
  241.    the LOGIN command before any IMAP2bis commands are permitted.  The
  242.    only other permitted command prior to successful authentication is
  243.    LOGOUT.  See the section below on authentication.
  244.  
  245.    Once authenticated, the client must send a mailbox selection command
  246.    to access the desired mailbox; no mailbox is selected by default.
  247.    Mailbox names are implementation dependent.  However, the word
  248.    "INBOX" must be implemented to mean the primary or default mailbox
  249.    for this user, independent of any other server semantics.  It is
  250.    permitted for a server not to have an INBOX if there is no concept of
  251.    a primary or default mailbox for this user.  The name "INBOX" MUST
  252.    NOT be used for any other purpose.
  253.  
  254.    On a successful selection, the server will send a list of valid
  255.    flags, number of messages, and number of messages arrived since last
  256.    access for this mailbox as unsolicited data, followed by an OK
  257.    response.  The client may terminate access to this mailbox and access
  258.    a different one with another selection command.
  259.  
  260.    The client requests mailbox data with FETCH commands, and receives it
  261.    via the unsolicited data mechanism.  Three major categories of
  262.    mailbox data exist.
  263.  
  264.    The first category is data that is associated with a message as an
  265.    entity in the mailbox.  There are now four such items of data: the
  266.    "internal date", the "RFC 822 size", the "flags", and the "unique
  267.    id".  The internal date is the date and time that the message was
  268.    placed in the mailbox.  The RFC 822 size is the size in bytes of the
  269.    message, expressed as an RFC 822 text string.  The flags are a list
  270.    of status flags associated with the message.  The unique id is an
  271.    identifier which is guaranteed to refer to this message and to none
  272.    other and which, unlike IMAP2bis sequence numbers, persists across
  273.    sessions.
  274.  
  275.    The second category is data that describes the composition and
  276.  
  277.  
  278.  
  279. Crispin                                                         [Page 5]
  280.  
  281. Internet Draft                  IMAP2bis                 August 13, 1993
  282.  
  283.  
  284.    delivery information of a message; that is, information such as the
  285.    message sender, recipient lists, message-ID, subject, MIME structure,
  286.    etc.  This is the information that is stored in the RFC 822 and MIME
  287.    headers.  In IMAP2bis, the RFC 822 header information that may be
  288.    fetched is called the "envelope" (not to be confused with SMTP
  289.    envelopes).  Similarly, the MIME header information that may be
  290.    fetched is called the "body".  A client can use the parsed envelope
  291.    and body and not worry about having to do its own RFC 822 or MIME
  292.    parsing.
  293.  
  294.    The third category is textual data, some of which is intended for
  295.    direct human viewing.  IMAP2bis defines six such items:
  296.    RFC822.HEADER, RFC822.HEADER.LINES, RFC822.HEADER.LINES.NOT,
  297.    RFC822.TEXT, RFC822, and MIME body parts.  It is possible to fetch an
  298.    individual MIME body part of a message without fetching any other
  299.    data associated with the message.
  300.  
  301.    In the simplest case, a client can "FETCH RFC822" to get the entire
  302.    message without any processing.  A more sophisticated client might
  303.    fetch some combination of the first and second categories of data for
  304.    use as a presentation menu.  Then, when the user wishes to read a
  305.    particular message, it will fetch the appropriate texts.
  306.  
  307.    Data structures in IMAP2bis are represented as an S-expression list
  308.    similar to that used in the Lisp programming language.  An S-
  309.    expression consists of a sequence of data items delimited by space
  310.    and bounded at each end by parentheses.  An S-expression may itself
  311.    contain other S-expressions, using parentheses to indicate nesting.
  312.    S-expression syntax was chosen because it provides a concise and
  313.    precise means of expressing nested data (e.g. MIME structure).
  314.  
  315.    The client can alter certain data with a STORE command.  As an
  316.    example, a message is deleted from a mailbox by setting the \DELETED
  317.    flag with a STORE command.
  318.  
  319.    Other client operations that can be done to a mailbox include copying
  320.    messages to other mailboxes, permanently removing deleted messages,
  321.    checking for updated mailbox state, and searching for messages that
  322.    match certain criteria.  It is also possible to select different
  323.    mailboxes, create a new mailbox, and rename or delete an existing
  324.    mailbox.
  325.  
  326.    The client should terminate the session with the LOGOUT command.  The
  327.    server returns a "BYE" followed by an "OK", at which point both the
  328.    client and the server close the connection.  If the client closes the
  329.    network connection without a LOGOUT command, the server should
  330.    perform its normal logout procedures without attempting any further
  331.    interaction with the client.
  332.  
  333.  
  334.  
  335. Crispin                                                         [Page 6]
  336.  
  337. Internet Draft                  IMAP2bis                 August 13, 1993
  338.  
  339.  
  340. Authentication
  341.  
  342.    Pre-authentication is only possible when the connection to the
  343.    IMAP2bis service is made through some link protocol which provides
  344.    its own authentication mechanism.  It is not used with a TCP
  345.    connection to port 143.
  346.  
  347.    An example of pre-authentication is the BSD "RSH" protocol which
  348.    provides authentication through a "trusted host" facility.  Another
  349.    example would be a manual invocation of an IMAP2bis server from a
  350.    logged-in timesharing job.
  351.  
  352.    A pre-authenticated IMAP2bis server should recognize that
  353.    authentication has already happened, and enter the post-login state.
  354.    In its greeting message, it should use the unsolicited response
  355.    "PREAUTH" instead of "OK" to indicate that external authentication
  356.    has taken place.
  357.  
  358.    This is an example of a pre-authentication scenario.  In this and all
  359.    other examples in this document, S: indicates server dialog and C:
  360.    indicates client dialog.
  361.  
  362.            S: * PREAUTH IMAP2bis Server pre-authenticated as user "Smith"
  363.            C: A001 SELECT INBOX
  364.            S: * FLAGS (\Answered \Flagged \Deleted \Seen)
  365.            S: * 19 EXISTS
  366.            S: * 2 RECENT
  367.            S: A001 OK SELECT complete
  368.  
  369.    A connection that is not pre-authenticated is constrained to using
  370.    the LOGIN command for establishing authentication.  Authentication
  371.    via the LOGIN command is with either a user name and password pair,
  372.    or with an user identifier and Kerberos authenticator.  See the
  373.    description of the LOGIN command for more details.
  374.  
  375.    Servers may allow non-authenticated access to certain mailboxes or
  376.    bulletin boards.  By convention, this is accomplished with a LOGIN
  377.    command using the userid "anonymous".  A password is still required.
  378.    It is implementation-dependent what requirements, if any, are placed
  379.    upon the password and what access restrictions are placed on
  380.    anonymous users.
  381.  
  382.    Implementations are NOT required to support pre-authentication,
  383.    Kerberos authentication, or the anonymous convention in order to be
  384.    considered IMAP2bis compliant.
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391. Crispin                                                         [Page 7]
  392.  
  393. Internet Draft                  IMAP2bis                 August 13, 1993
  394.  
  395.  
  396. Definitions of Commands and Responses
  397.  
  398.      Summary of Defined Commands and Responses
  399.  
  400.        Commands                            ||  Responses
  401.        --------                            ||  -------
  402.        tag NOOP                            ||  tag OK response_text
  403.        tag LOGIN user password             ||  tag NO response_text
  404.        tag LOGOUT                          ||  tag BAD response_text
  405.        tag CREATE mailbox                  ||  * PREAUTH response_text
  406.        tag DELETE mailbox                  ||  * OK response_text
  407.        tag RENAME old_mailbox new_mailbox  ||  * NO response_text
  408.        tag FIND MAILBOXES pattern          ||  * BAD response_text
  409.        tag FIND ALL.MAILBOXES pattern      ||  * BYE response_text
  410.        tag FIND BBOARDS pattern            ||  * MAILBOX mstring
  411.        tag FIND ALL.BBOARDS pattern        ||  * BBOARD mstring
  412.        tag SUBSCRIBE MAILBOX mailbox       ||  * SEARCH 1#number
  413.        tag UNSUBSCRIBE MAILBOX mailbox     ||  * FLAGS flag_list
  414.        tag SUBSCRIBE BBOARD mailbox        ||  * number EXISTS
  415.        tag UNSUBSCRIBE BBOARD mailbox      ||  * number RECENT
  416.        tag SELECT mailbox                  ||  * number EXPUNGE
  417.        tag EXAMINE mailbox                 ||  * number FETCH data
  418.        tag BBOARD mailbox                  ||  * number COPY
  419.        tag CHECK                           ||  * number STORE data
  420.        tag EXPUNGE                         ||  + text
  421.        tag COPY sequence mailbox           ||
  422.        tag APPEND mailbox string           ||
  423.        tag FETCH sequence data             ||
  424.        tag PARTIAL msgno data start count  ||
  425.        tag STORE sequence data value       ||
  426.        tag UID AFTER uniqueid              ||
  427.        tag UID BEFORE uniqueid             ||
  428.        tag UID COPY sequence mailbox       ||
  429.        tag UID FETCH sequence data         ||
  430.        tag UID STORE sequence data value   ||
  431.        tag SEARCH search_program           ||
  432.        tag x_command arguments             ||
  433.  
  434.    Note: there is no pairing between commands and responses on the same
  435.    line.  Any command may result in any number (including none at all)
  436.    of any of responses beginning with "*" (referred to as "unsolicited
  437.    data"), followed by one tagged response.
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447. Crispin                                                         [Page 8]
  448.  
  449. Internet Draft                  IMAP2bis                 August 13, 1993
  450.  
  451.  
  452. Commands
  453.  
  454.    Certain commands and facilities described below are listed as
  455.    "optional".  This term is used to identify server capabilities which
  456.    may not be present in a minimal server implementation or a server
  457.    implementation based upon an older version of this specification.
  458.    Such a server is considered to be IMAP2bis compatible (but not
  459.    necessarily compliant) if it implements all commands which are not
  460.    labeled as "optional".
  461.  
  462.    An IMAP2bis compliant server implementation MUST implement all of the
  463.    commands and facilities listed below, whether or not they are
  464.    labelled as "optional".
  465.  
  466.    An IMAP2bis compliant client MUST be prepared to accept BAD as a
  467.    response to any of the optional commands or facilities, and
  468.    substitute alternate or default action in that case.
  469.  
  470.    If, during the execution of any command, the server observes that the
  471.    mailbox size has changed, the server should output an unsolicited
  472.    EXISTS and RECENT response reflecting the changed size to alert the
  473.    client.  Similarly, any observed change in message status should
  474.    cause an unsolicited FETCH response with the new flag data.
  475.  
  476.  
  477.    tag NOOP
  478.  
  479.       The NOOP command returns an OK to the client.  By itself, it does
  480.       nothing else.  However, since any command can return a status
  481.       update as unsolicited data, this command can be used to poll for
  482.       new mail or for message status updates.
  483.  
  484.       Another possible use of this command is for the client to "ping"
  485.       the server so that the client and server know that each other are
  486.       still alive.  This is useful with servers that have an inactivity
  487.       autologout timer.
  488.  
  489.  
  490.    tag LOGIN user password
  491.  
  492.       The LOGIN command identifies the user to the server and carries
  493.       the password authenticating this user.  This information is used
  494.       by the server to control access to the mailboxes.
  495.  
  496.       EXAMPLE:  a001 LOGIN SMITH SESAME
  497.       logs in as user SMITH with password SESAME.
  498.  
  499.       If a server supports authentication via Kerberos, it may accept
  500.  
  501.  
  502.  
  503. Crispin                                                         [Page 9]
  504.  
  505. Internet Draft                  IMAP2bis                 August 13, 1993
  506.  
  507.  
  508.       the string "@KERBEROS:" followed by the hexadecimal representation
  509.       of a Kerberos authenticator.
  510.  
  511.       EXAMPLE: The following is a Kerberos login scenario (note that the
  512.       line breaks in the sample authenticator are for editorial clarity
  513.       and are not in a real authenticator):
  514.  
  515.          S: * OK Kerberos IMAP2bis Server
  516.          C: a001 LOGIN smith @KERBEROS:040700414e445245572e434d552e4544550
  517.             038202c868f3890b377fc8266acc1bedb96b80d3fa76489898e74cd1c952dc
  518.             4003ea3428f29f1c470016cf5adc22f939e6deff2747254c1815d5b0b90d4c
  519.             5a2cba21eb0abe32f9acbf568d751bf4cc13f5ba4e6d82c638a8b5421
  520.          S: a001 OK [df84a4cb8323454f] Login OK via Kerberos
  521.  
  522.       The token in the brackets in the OK response is the Kerberos
  523.       authentication response, encrypted with the session key in network
  524.       byte order and an incremented checksum as in the usual Kerberos
  525.       procedure.
  526.  
  527.  
  528.    tag LOGOUT
  529.  
  530.       The LOGOUT command informs the server that the client is done with
  531.       the session.  The server should send an unsolicited BYE response
  532.       before the (tagged) OK response, and then close the network
  533.       connection.
  534.  
  535.  
  536.    Mailbox manipulation commands: CREATE, DELETE, RENAME
  537.  
  538.    These commands permit the manipulation of entire mailboxes.  Server
  539.    support for mailbox manipulation commands is optional.
  540.  
  541.       tag CREATE mailbox
  542.  
  543.          The CREATE command creates a mailbox with the given name.  This
  544.          command returns an OK response only if a new mailbox with that
  545.          name has been created.  It is an error to attempt to create a
  546.          mailbox with a name that refers to an extant mailbox.  Any
  547.          error in creation will return a NO response.
  548.  
  549.          Creating INBOX is not permitted.  If there is a primary or
  550.          default mailbox for this user, it MUST exist and be called
  551.          INBOX.
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559. Crispin                                                        [Page 10]
  560.  
  561. Internet Draft                  IMAP2bis                 August 13, 1993
  562.  
  563.  
  564.       tag DELETE mailbox
  565.  
  566.          The DELETE command deletes a mailbox with the given name.  This
  567.          command returns an OK response only if a mailbox with that name
  568.          has been deleted.  It is an error to attempt to delete a
  569.          mailbox name that does not exist.  Any error in deletion will
  570.          return a NO response.
  571.  
  572.          A server SHOULD NOT attempt to test that a mailbox is empty
  573.          prior to permitting deletion; this would prevent the deletion
  574.          of a mailbox which for some reason can not be opened or
  575.          expunged, leaving to possible denial of service problems.  Any
  576.          such checking should be left to the discretion of the client.
  577.  
  578.          Deleting INBOX is not permitted.
  579.  
  580.  
  581.       tag RENAME old_mailbox new_mailbox
  582.  
  583.          The RENAME command changes the name of a mailbox.  This command
  584.          returns an OK response only if a mailbox with the old name
  585.          exists and has been successfully renamed to the new name.  It
  586.          is an error to attempt to rename with an old mailbox name that
  587.          does not exist or a new mailbox name which already exists.  Any
  588.          error in renaming will return a NO response.
  589.  
  590.          Renaming INBOX is permitted.  A new, empty INBOX is created in
  591.          its place.
  592.  
  593.  
  594.    FIND commands
  595.  
  596.    The FIND commands return some set of unsolicited MAILBOX or BBOARD
  597.    replies, depending upon the type of FIND, that have as their value a
  598.    single mailbox name.
  599.  
  600.    Three wildcard characters are defined in the pattern argument.  "*"
  601.    specifies any number (including zero) characters may match at this
  602.    position.  "%" and "?"  specify a single character may match at this
  603.    position.  For example, FOO*BAR will match FOOBAR, FOOD.ON.THE.BAR
  604.    and FOO.BAR, whereas FOO%BAR and FOO?BAR match only FOO.BAR.  "*"
  605.    will match all mailboxes.
  606.  
  607.    Server support for all forms of FIND is optional.  If a FIND command
  608.    returns BAD as a response then the client can make no assumptions
  609.    about what mailboxes exist on the server.
  610.  
  611.  
  612.  
  613.  
  614.  
  615. Crispin                                                        [Page 11]
  616.  
  617. Internet Draft                  IMAP2bis                 August 13, 1993
  618.  
  619.  
  620.       tag FIND MAILBOXES pattern
  621.  
  622.          The FIND MAILBOXES command accepts as an argument a pattern
  623.          (including wildcards) that specifies some set of mailbox names
  624.          that the user has declared as being "active" or "subscribed."
  625.          The exact meaning of this is implementation-dependent, since
  626.          the concept of a set of "active" or "subscribed" mailboxes that
  627.          is preserved across sessions may not be meaningful for a
  628.          particular server or server implementation.  If the SUBSCRIBE
  629.          MAILBOX and UNSUBSCRIBE MAILBOX commands are implemented then
  630.          this command returns the list manipulated by those commands.
  631.  
  632.          EXAMPLE:  C: A002 FIND MAILBOXES *
  633.                    S: * MAILBOX FOOBAR
  634.                    S: * MAILBOX GENERAL
  635.                    S: A002 OK FIND completed
  636.  
  637.  
  638.       tag FIND ALL.MAILBOXES pattern
  639.  
  640.          The FIND ALL.MAILBOXES command is similar to FIND MAILBOXES;
  641.          however, it should return a complete list of all mailboxes
  642.          available to the user.  Data is returned as in FIND MAILBOXES.
  643.  
  644.          The special name INBOX is included in the output from FIND
  645.          ALL.MAILBOXES unless INBOX is not supported by this server or
  646.          for this user.  The criteria for omitting INBOX is whether or
  647.          not SELECT INBOX will return failure; it is not relevant
  648.          whether or not the user's actual INBOX resides on this or some
  649.          other server.  FIND MAILBOXES and SUBSCRIBE MAILBOX provide a
  650.          mechanism for the user to identify that this is his or her real
  651.          INBOX.
  652.  
  653.          If FIND ALL.MAILBOXES is implemented FIND MAILBOXES must also
  654.          be implemented, even if it returns the same information.  Also,
  655.          FIND ALL.MAILBOXES must, at least, return all the mailbox names
  656.          that are returned by FIND MAILBOXES.
  657.  
  658.          The exact meaning of this is implementation-dependent, since
  659.          the concept of a bounded or deterministic set of "mailboxes
  660.          available to the user" may not be meaningful for a particular
  661.          server or server implementation.
  662.  
  663.  
  664.       tag FIND BBOARDS pattern
  665.  
  666.          The FIND BBOARDS command accepts as an argument a pattern that
  667.          specifies some set of bulletin board names that the user has
  668.  
  669.  
  670.  
  671. Crispin                                                        [Page 12]
  672.  
  673. Internet Draft                  IMAP2bis                 August 13, 1993
  674.  
  675.  
  676.          declared as being "active" or "subscribed."  Wildcards are
  677.          permitted as in FIND MAILBOXES.
  678.  
  679.          The FIND BBOARDS command will return some set of unsolicited
  680.          BBOARD replies that have as their value a single bulletin board
  681.          name.
  682.  
  683.          EXAMPLE:  C: A002 FIND BBOARDS *
  684.                    S: * BBOARD FOOBAR
  685.                    S: * BBOARD GENERAL
  686.                    S: A002 OK FIND completed
  687.  
  688.          The exact meaning of this is implementation-dependent, since
  689.          the concept of a set of "active" or "subscribed" bboards that
  690.          is preserved across sessions may not be meaningful for a
  691.          particular server or server implementation.  If the SUBSCRIBE
  692.          BBOARD and UNSUBSCRIBE BBOARD commands are implemented then
  693.          this command returns the list manipulated by those commands.
  694.  
  695.  
  696.       tag FIND ALL.BBOARDS pattern
  697.  
  698.          The FIND ALL.BBOARDS command is similar to FIND BBOARDS;
  699.          however, it should return a complete list of all bulletin
  700.          boards available to the user.  Data is returned as in FIND
  701.          BBOARDS.
  702.  
  703.          If FIND ALL.BBOARDS is implemented FIND BBOARDS must also be
  704.          implemented, even if it returns the same information.  Also,
  705.          FIND ALL.BBOARDS must, at least, return all the bboard names
  706.          that are returned by FIND BBOARDS.
  707.  
  708.          The exact meaning of this is implementation-dependent, since
  709.          the concept of a bounded or deterministic set of "bboards
  710.          available to the user" may not be meaningful for a particular
  711.          server or server implementation.
  712.  
  713.  
  714.    Subscription commands
  715.  
  716.    These commands permit the manipulation of mailbox or bulletin board
  717.    subscriptions.  Server support for subscription commands is optional.
  718.    Subscription status should be preserved between sessions.
  719.  
  720.  
  721.       tag SUBSCRIBE MAILBOX mailbox
  722.  
  723.          The SUBSCRIBE MAILBOX command adds the specified mailbox name
  724.  
  725.  
  726.  
  727. Crispin                                                        [Page 13]
  728.  
  729. Internet Draft                  IMAP2bis                 August 13, 1993
  730.  
  731.  
  732.          to the list of "active" or "subscribed" mailboxes as returned
  733.          by the FIND MAILBOXES command.  This command returns an OK
  734.          response only if the subscription is successful.
  735.  
  736.          If SUBSCRIBE MAILBOX is implemented then FIND MAILBOXES must
  737.          also be implemented, and FIND ALL.MAILBOXES should be
  738.          implemented.
  739.  
  740.  
  741.       tag UNSUBSCRIBE MAILBOX mailbox
  742.  
  743.          The UNSUBSCRIBE MAILBOX command removes the specified mailbox
  744.          name from the list of "active" or "subscribed" mailboxes as
  745.          returned by the FIND MAILBOXES command.  This command returns
  746.          an OK response only if the unsubscription is successful.
  747.  
  748.          If UNSUBSCRIBE MAILBOX is implemented then SUBSCRIBE MAILBOXES
  749.          and FIND MAILBOXES must also be implemented, and FIND
  750.          ALL.MAILBOXES should be implemented.
  751.  
  752.  
  753.       tag SUBSCRIBE BBOARD bboard
  754.  
  755.          The SUBSCRIBE BBOARD command adds the specified mailbox name to
  756.          the list of "active" or "subscribed" bulletin boards as
  757.          returned by the FIND BBOARDS command.  This command returns an
  758.          OK response only if the subscription is successful.
  759.  
  760.          If SUBSCRIBE BBOARD is implemented then FIND BBOARDS must also
  761.          be implemented, and FIND ALL.BBOARDS should be implemented.
  762.  
  763.  
  764.       tag UNSUBSCRIBE BBOARD bboard
  765.  
  766.          The UNSUBSCRIBE BBOARD command removes the specified mailbox
  767.          name from the list of "active" or "subscribed" bulletin boards
  768.          as returned by the FIND BBOARDS command.  This command returns
  769.          an OK response only if the unsubscription is successful.
  770.  
  771.          If UNSUBSCRIBE BBOARD is implemented then SUBSCRIBE BBOARDS and
  772.          FIND BBOARDS must also be implemented, and FIND ALL.BBOARDS
  773.          should be implemented.
  774.  
  775.  
  776.    tag SELECT mailbox
  777.  
  778.       This command select a particular mailbox.  The server must check
  779.       that the user is permitted read access to this mailbox.  Before
  780.  
  781.  
  782.  
  783. Crispin                                                        [Page 14]
  784.  
  785. Internet Draft                  IMAP2bis                 August 13, 1993
  786.  
  787.  
  788.       returning an OK to the client, the server must send the following
  789.       unsolicited data to the client:
  790.          FLAGS        mailbox's defined flags
  791.          <n> EXISTS   the number of messages in the mailbox
  792.          <n> RECENT   the number of new messages in the mailbox
  793.       in order to define the initial state of the mailbox at the client.
  794.  
  795.       Multiple selection commands are permitted in a session, in which
  796.       case the previous mailbox is automatically deselected when a new
  797.       selection is made.
  798.  
  799.       The mailbox name INBOX is a special name reserved to mean "the
  800.       primary mailbox for this user on this server".  The format of
  801.       other mailbox names is implementation dependent.
  802.  
  803.       The text of an OK response to the SELECT command should begin with
  804.       either "[READ-ONLY]" or "[READ-WRITE]" to show the mailbox's
  805.       access status.
  806.  
  807.  
  808.    tag EXAMINE mailbox
  809.  
  810.       The EXAMINE command is similar to SELECT, and returns the same
  811.       output; however, the selected mailbox is identified as read-only
  812.       and no changes are permitted to this mailbox.  EXAMINE has the
  813.       same mailbox namespace as SELECT.
  814.  
  815.       Server support for EXAMINE is optional.
  816.  
  817.  
  818.    tag BBOARD mailbox
  819.  
  820.       The BBOARD command is similar to SELECT, and returns the same
  821.       output.  Its argument is a shared mailbox (bulletin board) name
  822.       instead of an ordinary mailbox.  There is no requirement that the
  823.       namespace for BBOARD be the same as that for SELECT and EXAMINE.
  824.       BBOARD also differs from EXAMINE in that it may allow changes
  825.       (e.g. marking a message as seen or deleted) to a mailbox; the
  826.       exact handling of this is implementation dependent.
  827.  
  828.       Server support for BBOARD is optional.
  829.  
  830.  
  831.    tag CHECK
  832.  
  833.       The CHECK command requests a checkpoint of the mailbox.  CHECK may
  834.       cause an operation which may take a non-instantaneous amount of
  835.       real-time to complete.  The exact meaning of a checkpoint is
  836.  
  837.  
  838.  
  839. Crispin                                                        [Page 15]
  840.  
  841. Internet Draft                  IMAP2bis                 August 13, 1993
  842.  
  843.  
  844.       implementation-dependent.  Possible interpretations include
  845.       forcing a update of the server's disk of all changes made to the
  846.       selected mailbox, rescanning of the entire mailbox, etc.  If an
  847.       implementation has no such considerations, CHECK should be
  848.       equivalent to NOOP.
  849.  
  850.       CHECK should NOT be used to poll for new mail; new mail checking
  851.       happens implicitly as part of every command.  NOOP should be used
  852.       for any new mail polling.  CHECK should NOT be used to get the
  853.       current size of the mailbox; there is no guarantee that CHECK will
  854.       cause an EXISTS or RECENT unsolicited response.
  855.  
  856.  
  857.    tag EXPUNGE
  858.  
  859.       The EXPUNGE command permanently removes all messages with the
  860.       \DELETED flag set from the currently selected mailbox.  Before
  861.       returning an OK to the client, for each message that is removed,
  862.       an unsolicited EXPUNGE response is sent.  The message number for
  863.       each successive message in the mailbox is immediately decremented
  864.       by 1; this means that if the last 5 messages in a 9-message mail
  865.       file are expunged you will receive 5 unsolicited EXPUNGE responses
  866.       for message 5.
  867.  
  868.  
  869.    tag COPY sequence mailbox
  870.  
  871.       The COPY command copies the specified message(s) to the specified
  872.       destination mailbox.
  873.  
  874.       If the destination mailbox does not exist, a server that supports
  875.       the CREATE command SHOULD return an error.  It SHOULD NOT
  876.       automatically create the mailbox.  Unless it is certain that the
  877.       destination mailbox can not be created, the server MUST, prior to
  878.       the tagged NO response, send an unsolicited OK response with text
  879.       beginning with the string "[TRYCREATE]".  This gives a hint to the
  880.       client that it can attempt a CREATE command and retry the COPY if
  881.       the CREATE is successful.
  882.  
  883.       If the COPY command is unsuccessful for any reason, IMAP2bis
  884.       compliant server implementations MUST restore the destination
  885.       mailbox to its state prior to the COPY.
  886.  
  887.       EXAMPLE:  A003 COPY 2:4 MEETING
  888.       copies messages 2, 3, and 4 to mailbox "MEETING".
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895. Crispin                                                        [Page 16]
  896.  
  897. Internet Draft                  IMAP2bis                 August 13, 1993
  898.  
  899.  
  900.    tag APPEND mailbox string
  901.  
  902.       The APPEND command appends the string, which is in the format of
  903.       an RFC 822 message, to the specified mailbox.  If the append is
  904.       unsuccessful for any reason the mailbox must be restored to its
  905.       state prior to the append; no partial appending is permitted.  If
  906.       the mailbox is presently selected, the normal new mail actions
  907.       should occur.
  908.  
  909.       If the destination mailbox does not exist, a server MUST return an
  910.       error, and MUST NOT automatically create the mailbox.  Unless it
  911.       is certain that the destination mailbox can not be created, the
  912.       server MUST, prior to the tagged NO response, send an unsolicited
  913.       OK response with text beginning with the string "[TRYCREATE]".
  914.       This gives a hint to the client that it can attempt a CREATE
  915.       command and retry the APPEND if the CREATE is successful.
  916.  
  917.       Note that this functionality is unsuitable for message delivery,
  918.       because it does not provide a mechanism to transfer RFC 821 (SMTP)
  919.       envelope information.
  920.  
  921.       Server support for APPEND is optional.
  922.  
  923.  
  924.    tag FETCH sequence data
  925.  
  926.       The FETCH command retrieves data associated with a message in the
  927.       mailbox.  The data items to be fetched may be either a single atom
  928.       or an S-expression list.  The currently defined data items that
  929.       can be fetched are:
  930.  
  931.       ALL             Macro equivalent to:
  932.                       (FLAGS INTERNALDATE RFC822.SIZE ENVELOPE)
  933.  
  934.       BODY            The MIME body structure of the message.  The
  935.                       body is computed by the server by parsing the
  936.                       MIME header lines.
  937.  
  938.                       Server support for this data item is optional.
  939.  
  940.       BODY[section]   The text of a particular body section.  The
  941.                       section specification is a set of one or more
  942.                       part numbers delimited by periods.
  943.  
  944.                       Single-part messages only have a part 1.
  945.  
  946.                       Multipart messages are assigned consecutive
  947.                       part numbers, as they occur in the message.
  948.  
  949.  
  950.  
  951. Crispin                                                        [Page 17]
  952.  
  953. Internet Draft                  IMAP2bis                 August 13, 1993
  954.  
  955.  
  956.                       If a particular part is of type message or multipart,
  957.                       its parts must be indicated by a period followed by
  958.                       the part number within that nested multipart part.
  959.                       It is not permitted to fetch a multipart part
  960.                       itself, only its individual members.
  961.  
  962.                       A part of type MESSAGE also has nested parts,
  963.                       which are the parts of the MESSAGE part's body.
  964.  
  965.                       Every message has at least one part.
  966.  
  967.                       EXAMPLE: Here is a very complex message with its
  968.                       associated section specifications.
  969.                            1   TEXT/PLAIN
  970.                            2   APPLICATION/OCTET-STREAM
  971.                            3   MESSAGE/RFC822
  972.                            3.1   TEXT/PLAIN
  973.                            3.2   APPLICATION/OCTET-STREAM
  974.                                MULTIPART/MIXED
  975.                            4.1   IMAGE/GIF
  976.                            4.2   MESSAGE/RFC822
  977.                            4.2.1   TEXT/PLAIN
  978.                                    MULTIPART/ALTERNATIVE
  979.                            4.2.2.1  TEXT/PLAIN
  980.                            4.2.2.2  TEXT/RICHTEXT
  981.                       Note that there is no section specification for
  982.                       the Multi-part parts (no section 4 or 4.2.2).
  983.  
  984.                       The \SEEN flag is implicitly set; if this causes
  985.                       the flags to change they should be included as
  986.                       part of the fetch results.
  987.  
  988.                       Server support for this data item is optional.
  989.  
  990.       ENVELOPE        The envelope of the message.  The envelope is
  991.                       computed by the server by parsing the RFC 822
  992.                       header into the component parts, defaulting
  993.                       various fields as necessary.
  994.  
  995.       FAST            Macro equivalent to:
  996.                       (FLAGS INTERNALDATE RFC822.SIZE)
  997.  
  998.       FLAGS           The flags that are set for this message.
  999.  
  1000.       FULL            Macro equivalent to:
  1001.                       (FLAGS INTERNALDATE RFC822.SIZE ENVELOPE BODY)
  1002.  
  1003.                       Server support for this data item is optional.
  1004.  
  1005.  
  1006.  
  1007. Crispin                                                        [Page 18]
  1008.  
  1009. Internet Draft                  IMAP2bis                 August 13, 1993
  1010.  
  1011.  
  1012.       INTERNALDATE    The date and time the message was written to
  1013.                       the mailbox.
  1014.  
  1015.       RFC822          The message in RFC 822 format.  The \SEEN
  1016.                       flag is implicitly set; if this causes the
  1017.                       flags to change they should be included as
  1018.                       part of the fetch results.  This is the
  1019.                       concatenation of RFC822.HEADER and RFC822.TEXT.
  1020.  
  1021.       RFC822.HEADER   The RFC 822 format header of the message as
  1022.                       stored on the server including the delimiting
  1023.                       blank line between the header and the body.
  1024.  
  1025.       RFC822.HEADER.LINES header_line_list
  1026.                       All header lines (including continuation lines)
  1027.                       of the RFC 822 format header of the message
  1028.                       with a field-name (as defined in RFC 822) that
  1029.                       matches any of the strings in header_line_list.
  1030.                       The matching is case-independent but otherwise
  1031.                       exact.
  1032.  
  1033.                       This is used to obtain a filtered header
  1034.                       containing only desired header lines.
  1035.  
  1036.                       Server support for this data item is optional.
  1037.  
  1038.       RFC822.HEADER.LINES.NOT header_line_list
  1039.                       All header lines (including continuation lines)
  1040.                       of the RFC 822 format header of the message
  1041.                       with a field-name (as defined in RFC 822) that
  1042.                       does not match any of the strings in
  1043.                       header_line_list.  The matching is
  1044.                       case-independent but otherwise exact.
  1045.  
  1046.                       This is used to obtain a filtered header not
  1047.                       containing undesired header lines.
  1048.  
  1049.                       Server support for this data item is optional.
  1050.  
  1051.       RFC822.SIZE     The number of characters in the message as
  1052.                       expressed in RFC 822 format.
  1053.  
  1054.       RFC822.TEXT     The text body of the message, omitting the
  1055.                       RFC 822 header.  The \SEEN flag is implicitly
  1056.                       set; if this causes the flags to change they
  1057.                       should be included as part of the fetch results.
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063. Crispin                                                        [Page 19]
  1064.  
  1065. Internet Draft                  IMAP2bis                 August 13, 1993
  1066.  
  1067.  
  1068.       UID             The unique identifier for the message.
  1069.  
  1070.                       Server support for this data item is optional.
  1071.  
  1072.       EXAMPLES:
  1073.  
  1074.       A003 FETCH 2:4 ALL
  1075.          fetches the flags, internal date, RFC 822 size, and envelope
  1076.          for messages 2, 3, and 4.
  1077.  
  1078.       A004 FETCH 3 RFC822
  1079.          fetches the RFC 822 representation for message 3.
  1080.  
  1081.       A005 FETCH 4 (FLAGS RFC822.HEADER)
  1082.          fetches the flags and RFC 822 format header for message 4.
  1083.  
  1084.  
  1085.    tag PARTIAL msgno data start_byte byte_count
  1086.  
  1087.       The PARTIAL command is equivalent to the associated FETCH command,
  1088.       with the added functionality that only the specified number of
  1089.       bytes, beginning at the specified starting byte, are returned.
  1090.       Note that only a single message can be fetched at a time.  The
  1091.       first byte of a message, and hence the minimum for the starting
  1092.       byte, is byte 1.
  1093.  
  1094.       The following FETCH items are valid data for PARTIAL: RFC822,
  1095.       RFC822.HEADER, RFC822.TEXT, and BODY[section].
  1096.  
  1097.       Any partial fetch which attempts to read beyond the end of the
  1098.       text is truncated as appropriate.  If the starting byte is beyond
  1099.       the end of the text, an empty string is returned.
  1100.  
  1101.       The data is returned with the FETCH response.  There is no
  1102.       indication of the range of the partial data in this response; thus
  1103.       it is generally not possible to implement caching with PARTIAL
  1104.       data.  It is also not possible to stream multiple PARTIAL commands
  1105.       of the same data item without processing and synchronizing at each
  1106.       step, since each PARTIAL fetch of data replaces any prior
  1107.       (PARTIAL) FETCH of that data.
  1108.  
  1109.       Note that when partial fetching it is possible to break in the
  1110.       middle of a a line or a criticial sequence such as a BASE64
  1111.       quadruple or QUOTED-PRINTABLE shift.  Implementations using
  1112.       partial fetching should keep this in mind.  There is no
  1113.       requirement that partial fetches follow any sequence; so if it
  1114.       turns out that a partial fetch of bytes 1 through 10000 breaks in
  1115.       an awkward place, it is permitted to continue with a partial fetch
  1116.  
  1117.  
  1118.  
  1119. Crispin                                                        [Page 20]
  1120.  
  1121. Internet Draft                  IMAP2bis                 August 13, 1993
  1122.  
  1123.  
  1124.       of 9987 through 19987, etc.
  1125.  
  1126.       The handling of the \SEEN flag is the same as with the FETCH
  1127.       command.
  1128.  
  1129.       Server support for PARTIAL is optional.
  1130.  
  1131.  
  1132.    tag STORE sequence data value
  1133.  
  1134.       The STORE command alters data associated with a message in the
  1135.       mailbox.  The currently defined data items that can be stored are:
  1136.  
  1137.          FLAGS           Replace the flags for the message with the
  1138.                          argument (in flag list format).
  1139.  
  1140.          +FLAGS          Add the flags in the argument to the
  1141.                          message's flag list.
  1142.  
  1143.          -FLAGS          Remove the flags in the argument from the
  1144.                          message's flag list.
  1145.  
  1146.       EXAMPLE:  A003 STORE 2:4 +FLAGS (\DELETED)
  1147.       marks messages 2, 3, and 4 for deletion.
  1148.  
  1149.  
  1150.    UID commands
  1151.  
  1152.    These commands use unique identifiers instead of message numbers in
  1153.    their arguments to reference a particular message or range of
  1154.    messages.
  1155.  
  1156.    Sequence ranges are permitted; note however that there is no
  1157.    guarantee that unique identifiers be contiguous.  A non-existant
  1158.    unique identifier within a sequence range is ignored without any
  1159.    error message generated.
  1160.  
  1161.    Because of the potential for ambiguity, the UID command does not
  1162.    change responses.  That is, the number after the "*" in an
  1163.    unsolicited FETCH response is a message number, not a unique
  1164.    identifier.  However, servers MUST implicitly include UID as part of
  1165.    any FETCH response caused by a UID command, regardless of whether or
  1166.    not UID was specified.
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175. Crispin                                                        [Page 21]
  1176.  
  1177. Internet Draft                  IMAP2bis                 August 13, 1993
  1178.  
  1179.  
  1180.    EXAMPLE:  C: A003 UID FETCH 4827313:4828442 FLAGS
  1181.              S: * 23 FETCH (FLAGS (\SEEN) UID 4827313)
  1182.              S: * 24 FETCH (FLAGS (\SEEN) UID 4827943)
  1183.              S: * 25 FETCH (FLAGS (\SEEN) UID 4828442)
  1184.              S: A003 UID FETCH completed
  1185.  
  1186.  
  1187.       tag UID AFTER uniqueid
  1188.  
  1189.          The UID AFTER command is used to determine what unique
  1190.          identifiers exist that are greater than the specified unique
  1191.          identifier.  It returns unsolicited FETCH responses for each
  1192.          such message.
  1193.  
  1194.          For example, if the specified unique identifier refers to
  1195.          message 572 in a mailbox with 613 messages, the results
  1196.          returned are equivalent to doing "FETCH 573:613 UID".
  1197.  
  1198.  
  1199.       tag UID BEFORE uniqueid
  1200.  
  1201.          The UID BEFORE command is used to determine what unique
  1202.          identifiers exist that are less than the specified unique
  1203.          identifier.  It returns unsolicited FETCH responses for each
  1204.          such message.
  1205.  
  1206.          For example, if the specified unique identifier refers to
  1207.          message 572 in a mailbox with 613 messages, the results
  1208.          returned are equivalent to doing "FETCH 1:571 UID".
  1209.  
  1210.  
  1211.       tag UID COPY sequence mailbox
  1212.  
  1213.          The UID COPY command is identical to the COPY command, with the
  1214.          exception that the numbers used in the sequence are unique
  1215.          identifiers instead of message numbers.
  1216.  
  1217.  
  1218.       tag UID FETCH sequence data
  1219.  
  1220.          The UID FETCH command is identical to the FETCH command, with
  1221.          the exception that the numbers used in the sequence are unique
  1222.          identifiers instead of message numbers.
  1223.  
  1224.  
  1225.       tag UID STORE sequence data value
  1226.  
  1227.          The UID STORE command is identical to the STORE command, with
  1228.  
  1229.  
  1230.  
  1231. Crispin                                                        [Page 22]
  1232.  
  1233. Internet Draft                  IMAP2bis                 August 13, 1993
  1234.  
  1235.  
  1236.          the exception that the numbers used in the sequence are unique
  1237.          identifiers instead of message numbers.
  1238.  
  1239.  
  1240.    tag SEARCH search_criteria
  1241.  
  1242.       The SEARCH command searches the mailbox for messages that match
  1243.       the given set of criteria.  The unsolicited SEARCH <1#number>
  1244.       response from the server is a list of messages that express the
  1245.       intersection (AND function) of all the messages which match that
  1246.       criteria.  For example,
  1247.               A003 SEARCH DELETED FROM "SMITH" SINCE 1-OCT-87
  1248.       returns the message numbers for all deleted messages from Smith
  1249.       that were placed in the mail file since October 1, 1987.
  1250.  
  1251.       In all search criteria which use strings, a message matches the
  1252.       criteria if the string is a substring of that field.  The matching
  1253.       is case-independent except as noted below.
  1254.  
  1255.       The string may be in RFC 1342 format to express a character set
  1256.       other than US-ASCII.  In this case, the criteria matches if the
  1257.       string matches the character set and characters of a substring of
  1258.       that field.  A server implementation may omit case-independent
  1259.       matching on RFC 1342 strings.
  1260.  
  1261.       The currently defined search criteria are:
  1262.  
  1263.       ALL             All messages in the mailbox; the default
  1264.                       initial criterion for ANDing.
  1265.  
  1266.       ANSWERED        Messages with the \ANSWERED flag set.
  1267.  
  1268.       BCC istring     Messages which contain the specified string
  1269.                       in the envelope's BCC field.
  1270.  
  1271.       BEFORE date     Messages whose internal date is earlier than
  1272.                       the specified date.
  1273.  
  1274.       BODY istring    Messages which contain the specified string
  1275.                       in the body of the message.
  1276.  
  1277.       CC istring      Messages which contain the specified string
  1278.                       in the envelope's CC field.
  1279.  
  1280.       DELETED         Messages with the \DELETED flag set.
  1281.  
  1282.       FLAGGED         Messages with the \FLAGGED flag set.
  1283.  
  1284.  
  1285.  
  1286.  
  1287. Crispin                                                        [Page 23]
  1288.  
  1289. Internet Draft                  IMAP2bis                 August 13, 1993
  1290.  
  1291.  
  1292.       FROM istring    Messages which contain the specified string
  1293.                       in the envelope's FROM field.
  1294.  
  1295.       KEYWORD flag    Messages with the specified flag set.
  1296.  
  1297.       NEW             Messages which have the \RECENT flag set but
  1298.                       not the \SEEN flag.  This is functionally
  1299.                       equivalent to "RECENT UNSEEN".
  1300.  
  1301.       OLD             Messages which do not have the \RECENT flag
  1302.                       set.
  1303.  
  1304.       ON date         Messages whose internal date is within the
  1305.                       specified date.
  1306.  
  1307.       RECENT          Messages which have the \RECENT flag set.
  1308.  
  1309.       SEEN            Messages which have the \SEEN flag set.
  1310.  
  1311.       SINCE date      Messages whose internal date is later than
  1312.                       the specified date.
  1313.  
  1314.       SUBJECT istring Messages which contain the specified string
  1315.                       in the envelope's SUBJECT field.
  1316.  
  1317.       TEXT istring    Messages which contain the specified string.
  1318.  
  1319.       TO istring      Messages which contain the specified string in
  1320.                       the envelope's TO field.
  1321.  
  1322.       UNANSWERED      Messages which do not have the \ANSWERED flag
  1323.                       set.
  1324.  
  1325.       UNDELETED       Messages which do not have the \DELETED flag
  1326.                       set.
  1327.  
  1328.       UNFLAGGED       Messages which do not have the \FLAGGED flag
  1329.                       set.
  1330.  
  1331.       UNKEYWORD flag  Messages which do not have the specified flag
  1332.                       set.
  1333.  
  1334.       UNSEEN          Messages which do not have the \SEEN flag set.
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343. Crispin                                                        [Page 24]
  1344.  
  1345. Internet Draft                  IMAP2bis                 August 13, 1993
  1346.  
  1347.  
  1348. Responses
  1349.  
  1350.    The first group of responses complete a request, and indicate whether
  1351.    or not the command was successful.  The response text is a line of
  1352.    human readable text, optionally prefixed by an atom inside square
  1353.    brackets that conveys a special information token between cooperating
  1354.    servers and clients.
  1355.  
  1356.    The currently defined special information tokens are:
  1357.  
  1358.       PARSE           An error occurred in parsing the RFC 822 or MIME
  1359.                       headers of a message in the mailbox.
  1360.  
  1361.       READ-ONLY       The mailbox is open read-only, or its access while
  1362.                       open has changed from read-write to read-only.
  1363.  
  1364.       READ-WRITE      The mailbox is open read-write, or its access while
  1365.                       open has changed from read-only to read-write.
  1366.  
  1367.       TRYCREATE       An APPEND or COPY attempt failed because the target
  1368.                       mailbox does not exist.  The server sends this as a
  1369.                       hint to the client that the operation would probably
  1370.                       succeed if the mailbox is first created by means of
  1371.                       the CREATE command.
  1372.  
  1373.       hex string      A hexadecimal string is returned as a special
  1374.                       information token to represent a Kerberos return
  1375.                       authenticator.  This only occurs in response to a
  1376.                       LOGIN command that uses Kerberos authentication.
  1377.  
  1378.    Other special information tokens defined by particular client or
  1379.    server implementations should be prefixed with an "X" until such time
  1380.    as they are added to a revision of this protocol.
  1381.  
  1382.  
  1383.    tag OK response_text
  1384.  
  1385.       This response identifies successful completion of the command with
  1386.       that tag.  The response text may be useful in a protocol telemetry
  1387.       log for debugging purposes.
  1388.  
  1389.  
  1390.    tag NO response_text
  1391.  
  1392.       This response identifies unsuccessful completion of the command
  1393.       with that tag.  The text is a line of human-readable text that
  1394.       probably should be displayed to the user in an error report by the
  1395.       client.
  1396.  
  1397.  
  1398.  
  1399. Crispin                                                        [Page 25]
  1400.  
  1401. Internet Draft                  IMAP2bis                 August 13, 1993
  1402.  
  1403.  
  1404.    tag BAD response_text
  1405.  
  1406.       This response identifies faulty protocol received from the client;
  1407.       The text is a line of human-readable text that should be recorded
  1408.       in any telemetry as part of a bug report to the maintainer of the
  1409.       client.
  1410.  
  1411.  
  1412.    The second group of responses convey human-readable information.  The
  1413.    response text is a line of human readable text, optionally prefixed
  1414.    by an atom inside square brackets that conveys special information
  1415.    between cooperating servers and clients.
  1416.  
  1417.  
  1418.    * PREAUTH response_text
  1419.  
  1420.       This response is one of three possible greetings at session
  1421.       startup.  It indicates that the session has already been
  1422.       authenticated by external means and thus no LOGIN command is
  1423.       needed.
  1424.  
  1425.  
  1426.    * OK response_text
  1427.  
  1428.       This response identifies an information message from the server.
  1429.       It does not indicate completion of any particular request, nor is
  1430.       it necessarily related to any request.  The text is a line of
  1431.       human-readable text that should be presented to the user as an
  1432.       information message.
  1433.  
  1434.       This response is also one of three possible greetings at session
  1435.       startup.  It indicates that the session is not yet authenticated
  1436.       and that a LOGIN command is needed.
  1437.  
  1438.  
  1439.    * NO response_text
  1440.  
  1441.       This response identifies a warning message from the server.  It
  1442.       does not indicate completion of any request, nor is it necessarily
  1443.       related to any request.  The text is a line of human-readable text
  1444.       that should be presented to the user as a warning of improper
  1445.       operation.
  1446.  
  1447.  
  1448.    * BAD response_text
  1449.  
  1450.       This response identifies a serious error message from the server.
  1451.       It does not indicate completion of any request, nor is it
  1452.  
  1453.  
  1454.  
  1455. Crispin                                                        [Page 26]
  1456.  
  1457. Internet Draft                  IMAP2bis                 August 13, 1993
  1458.  
  1459.  
  1460.       necessarily related to any request.  It may also indicate a faulty
  1461.       command from the client in which a tag could not be parsed.  The
  1462.       text is a line of human-readable text that should be presented to
  1463.       the user as a serious or possibly fatal error.
  1464.  
  1465.  
  1466.    * BYE text
  1467.  
  1468.       This response identifies that the server is about to close the
  1469.       connection.  The text is a line of human-readable text that should
  1470.       be displayed to the user in a status report by the client.  This
  1471.       may be sent as part of a normal logout sequence, or as a panic
  1472.       shutdown announcement by the server.  It is also used by some
  1473.       servers as an announcement of an inactivity autologout.
  1474.  
  1475.       This response is also one of three possible greetings at session
  1476.       startup.  It indicates that the server is not willing to accept a
  1477.       session from this client at the present time.
  1478.  
  1479.  
  1480.    The third group of responses convey data about the mailbox or
  1481.    messages inside the mailbox.  This is how message data is transmitted
  1482.    from the server to the client.
  1483.  
  1484.  
  1485.    * MAILBOX mstring
  1486.  
  1487.       This response occurs as a result of a FIND command for MAILBOXES
  1488.       and ALL.MAILBOXES.  The string is a mailbox name that matches the
  1489.       pattern in the command.
  1490.  
  1491.  
  1492.    * BBOARD mstring
  1493.  
  1494.       This response occurs as a result of a FIND command for BBOARDS and
  1495.       ALL.BBOARDS.  The string is a bulletin board name that matches the
  1496.       pattern in the command.
  1497.  
  1498.  
  1499.    * SEARCH number(s)
  1500.  
  1501.       This response occurs as a result of a SEARCH command.  The
  1502.       number(s) refer to those messages that match the search criteria.
  1503.       Each number is delimited by a space, e.g., "SEARCH 2 3 6".
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511. Crispin                                                        [Page 27]
  1512.  
  1513. Internet Draft                  IMAP2bis                 August 13, 1993
  1514.  
  1515.  
  1516.    * FLAGS flag_list
  1517.  
  1518.       This response occurs as a result of a selection command (SELECT,
  1519.       BBOARD, and EXAMINE).  The flag list are the list of flags (at a
  1520.       minimum, the system-defined flags) that are applicable for this
  1521.       mailbox.  Flags other than the system flags are a function of the
  1522.       server implementation.
  1523.  
  1524.  
  1525.    * number message_data
  1526.  
  1527.       This response occurs as a result of any command when a mailbox is
  1528.       selected. The message_data is one of the following:
  1529.  
  1530.  
  1531.       EXISTS  The specified number of messages exists in the mailbox.
  1532.  
  1533.  
  1534.       RECENT  The specified number of messages have arrived since the
  1535.               previous time this mailbox was read.
  1536.  
  1537.  
  1538.       EXPUNGE The specified message number has been permanently
  1539.               removed from the mailbox, and the next message in the
  1540.               mailbox (if any) becomes that message number.
  1541.  
  1542.               An unsolicited EXPUNGE response MUST NOT be sent except
  1543.               while responding to a request other than FETCH, STORE,
  1544.               or SEARCH.  All references to message numbers sent after
  1545.               an unsolicited EXPUNGE response are adjusted to reflect
  1546.               the effect of the expunge.
  1547.  
  1548.                  Discussion: a potential ambiguity exists with
  1549.                  the FETCH, STORE, and SEARCH requests if the
  1550.                  server is permitted to send unsolicited EXPUNGE
  1551.                  responses.  This is because these requests can be
  1552.                  streamed.  If two successive FETCH requests are
  1553.                  streamed, and if during the time of the processing
  1554.                  of the first request there is an expunge response,
  1555.                  then the sequence of the second request is no
  1556.                  longer valid.
  1557.  
  1558.  
  1559.       FETCH data
  1560.               This is the principle means by which data about a
  1561.               message is returned to the client.  The data is in a
  1562.               S-expression form, and consists of a sequence of pairs
  1563.               of data item name and their values.  The current data
  1564.  
  1565.  
  1566.  
  1567. Crispin                                                        [Page 28]
  1568.  
  1569. Internet Draft                  IMAP2bis                 August 13, 1993
  1570.  
  1571.  
  1572.               items are:
  1573.  
  1574.          BODY          An S-expression format list that describes the
  1575.                        body of a message.  The body is computed by the
  1576.                        server by parsing the RFC 822 header and body into
  1577.                        the component parts, defaulting various fields
  1578.                        as necessary.
  1579.  
  1580.                        Multiple parts are indicated by S-expression
  1581.                        nesting.  In this case, instead of a body type
  1582.                        as the first element of the list there is a nested
  1583.                        body.  The last element of the list is the multipart
  1584.                        subtype (mixed, digest, parallel, alternative, etc.).
  1585.  
  1586.                        The basic fields of a non-multipart body part are in
  1587.                        the following order:
  1588.                          body type - an atom giving the content type name
  1589.                            as defined in MIME
  1590.                          body subtype - a string giving the content subtype
  1591.                            name as defined in MIME
  1592.                          body parameter list - an S-expression list of
  1593.                            attribute/value pairs [e.g. (foo bar baz rag)
  1594.                            where "bar" is the value of "foo" and "rag" is
  1595.                            the value of "baz"] as defined in MIME.
  1596.                          body id - a string giving the content id as
  1597.                            defined in MIME.
  1598.                          body description - a string giving the content
  1599.                            description as defined in MIME.
  1600.                          body encoding - a string giving the content
  1601.                            transfer encoding as defined in MIME.
  1602.                          body size - a number giving the size of that
  1603.                            body in bytes.  Note that this size is the
  1604.                            size in its transfer encoding and not the
  1605.                            resulting size.
  1606.  
  1607.                        A body type of type MESSAGE and subtype RFC822
  1608.                        contains, immediately after the basic fields,
  1609.                        the envelope of the encapsulated message, its
  1610.                        body structure, and its size in text lines.
  1611.  
  1612.                        A body type of type TEXT contains, immediately
  1613.                        after the basic fields, the size of the body
  1614.                        in text lines.
  1615.  
  1616.          BODY[section] A string expressing the body contents of the
  1617.                        specified section.  This string is transmitted
  1618.                        as 7-bit US-ASCII, and interpreted according to
  1619.                        the content transfer encoding and the body type
  1620.  
  1621.  
  1622.  
  1623. Crispin                                                        [Page 29]
  1624.  
  1625. Internet Draft                  IMAP2bis                 August 13, 1993
  1626.  
  1627.  
  1628.                        and subtype.
  1629.  
  1630.                        Note that 7-bit US-ASCII is the transport format
  1631.                        and NOT necessarily the byte size or character
  1632.                        set of the result.  The resulting data may be
  1633.                        8-bit; it may also be some other character set
  1634.                        or binary.
  1635.  
  1636.          ENVELOPE      An S-expression format list that describes the
  1637.                        envelope of a message.  The envelope is computed
  1638.                        by the server by parsing the RFC 822 header into
  1639.                        the component parts, defaulting various fields
  1640.                        as necessary.
  1641.  
  1642.                        The fields of the envelope are in the following
  1643.                        order: date, subject, from, sender, reply-to, to,
  1644.                        cc, bcc, in-reply-to, and message-id.  The date,
  1645.                        subject, in-reply-to, and message-id fields are
  1646.                        strings.  The from, sender, reply-to, to, cc,
  1647.                        and bcc fields are lists of addresses.
  1648.  
  1649.                        An address is an S-expression format list that
  1650.                        describes an electronic mail address.  The fields
  1651.                        of an address are in the following order:
  1652.                        personal name, source-route (a.k.a. the
  1653.                        at-domain-list in SMTP), mailbox name, and
  1654.                        host name.
  1655.  
  1656.                        Any field of an envelope or address that is
  1657.                        not applicable is presented as the atom NIL.
  1658.                        Note that the server must default the reply-to
  1659.                        and sender fields from the from field; a client is
  1660.                        not expected to know to do this.
  1661.  
  1662.          FLAGS         An S-expression format list of flags that are set
  1663.                        for this message.  This may include the following
  1664.                        system flags:
  1665.  
  1666.                        \RECENT       Message arrived since the
  1667.                                       previous time this mailbox
  1668.                                       was read
  1669.                        \SEEN         Message has been read
  1670.                        \ANSWERED     Message has been answered
  1671.                        \FLAGGED      Message is "flagged" for
  1672.                                       urgent/special attention
  1673.                        \DELETED      Message is "deleted" for
  1674.                                       removal by later EXPUNGE
  1675.  
  1676.  
  1677.  
  1678.  
  1679. Crispin                                                        [Page 30]
  1680.  
  1681. Internet Draft                  IMAP2bis                 August 13, 1993
  1682.  
  1683.  
  1684.          INTERNALDATE  A string containing the date and time the
  1685.                        message was written to the mailbox.
  1686.  
  1687.          RFC822        A string expressing the message in RFC 822
  1688.                        format.
  1689.  
  1690.          RFC822.HEADER A string expressing the RFC 822 format header
  1691.                        of the message, including the delimiting
  1692.                        blank line between the header and the body.
  1693.                        This is used for the FETCH data items
  1694.                        RFC822.HEADER, RFC822.HEADER.LINES, and
  1695.                        RFC822.HEADER.LINES.NOT (note that a blank
  1696.                        line is always included regardless of header
  1697.                        line restrictions).
  1698.  
  1699.          RFC822.SIZE   A number indicating the number of
  1700.                        characters in the message as expressed
  1701.                        in RFC 822 format.
  1702.  
  1703.          RFC822.TEXT   A string expressing the text body of the
  1704.                        message, omitting the RFC 822 header.
  1705.  
  1706.          UID           A string expressing the unique identifier
  1707.                        of the message.
  1708.  
  1709.  
  1710.       COPY    Obsolete.  New server implementations MUST NOT transmit
  1711.               this response.  Client implementations SHOULD ignore
  1712.               this response (not report an error).
  1713.  
  1714.  
  1715.       STORE data
  1716.               Obsolete and functionally equivalent to FETCH.  New
  1717.               server implementations MUST NOT transmit this response.
  1718.               Client implementations SHOULD treat this response as
  1719.               equivalent to the FETCH response.
  1720.  
  1721.  
  1722.    The final group of responses contains a single, special purpose
  1723.    response.
  1724.  
  1725.    + text
  1726.  
  1727.       This response identifies that the server is ready to accept the
  1728.       text of a literal from the client.  The text of this response is a
  1729.       line of human-readable text of the server's choosing (it is
  1730.       generally never seen by a client's human user).
  1731.  
  1732.  
  1733.  
  1734.  
  1735. Crispin                                                        [Page 31]
  1736.  
  1737. Internet Draft                  IMAP2bis                 August 13, 1993
  1738.  
  1739.  
  1740.       The purpose of this command is to solve a synchronization problem
  1741.       which can occur if one of the strings in a command is a literal.
  1742.       This may occur when logging in (if the password contains "funny"
  1743.       characters) and especially with the APPEND command (since the
  1744.       message sent consists of multiple lines).
  1745.  
  1746.       Normally, a command from the client is a single text line.  If the
  1747.       server detects an error in the command, it can simply discard the
  1748.       remainder of the line.  It cannot do this for commands that
  1749.       contain literals, since a literal can be an arbitrarily long
  1750.       amount of text, and the server may not even be expecting a
  1751.       literal.  This mechanism is provided so the client knows not to
  1752.       send a literal until the server expects it, preserving
  1753.       client/server synchronization.
  1754.  
  1755.       No such synchronization protection is provided for literals sent
  1756.       from the server to the client.  Nor is any necessary.  Any
  1757.       synchronization problems in this direction would be caused by a
  1758.       bug in the client or server.
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791. Crispin                                                        [Page 32]
  1792.  
  1793. Internet Draft                  IMAP2bis                 August 13, 1993
  1794.  
  1795.  
  1796. Sample IMAP2bis session
  1797.  
  1798.    The following is a transcript of an IMAP2bis session.  One very long
  1799.    long line in this sample is broken for editorial clarity.
  1800.  
  1801.    S:   * OK IMAP2bis Service 7.2(62) at Thu, 29 Jul 1993 21:34:23 -0700 (PDT)
  1802.    C:   a001 login mrc secret
  1803.    S:   a001 OK LOGIN completed
  1804.    C:   a002 select inbox
  1805.    S:   * 18 EXISTS
  1806.    S:   * FLAGS (\Answered \Flagged \Deleted \Seen)
  1807.    S:   * 0 RECENT
  1808.    S:   a002 OK [READ-WRITE] SELECT completed
  1809.    S:   a003 fetch 12 full
  1810.    S:   * 12 FETCH (FLAGS (\Seen) INTERNALDATE "14-Jul-1993 02:44:25 -0700"
  1811.          RFC822.SIZE 4282 ENVELOPE ("Wed, 14 Jul 1993 02:23:25 -0700 (PDT)"
  1812.          "IMAP2bis WG mtg summary and minutes" (("Terry Gray" NIL "gray"
  1813.          "cac.washington.edu")) ((NIL NIL "owner-imap" "cac.washington.edu"))
  1814.          (("Terry Gray" NIL "gray" "cac.washington.edu")) ((NIL NIL "imap"
  1815.          "cac.washington.edu")) ((NIL NIL "minutes" "CNRI.Reston.VA.US")
  1816.          ("John C Klensin" NIL "KLENSIN" "INFOODS.MIT.EDU")("Erik Huizer"
  1817.          NIL "Erik.Huizer" "SURFnet.nl")) NIL NIL
  1818.          "<Pine.3.84.9307140123.B27397-0100000@shiva2.cac.washington.edu>")
  1819.           BODY ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 3028 92))
  1820.    S:    a003 OK FETCH completed
  1821.    C:    a004 fetch 12 rfc822.header
  1822.    S:    * 12 FETCH (RFC822.HEADER {485}
  1823.    S:    Date: Wed, 14 Jul 1993 02:23:25 -0700 (PDT)
  1824.    S:    From: Terry Gray <gray@cac.washington.edu>
  1825.    S:    Reply-To: Terry Gray <gray@cac.washington.edu>
  1826.    S:    Subject: IMAP2bis WG mtg summary and minutes
  1827.    S:    To: imap@cac.washington.edu
  1828.    S:    Cc: minutes@CNRI.Reston.VA.US,
  1829.    S:            John C Klensin <KLENSIN@INFOODS.MIT.EDU>,
  1830.    S:            Erik Huizer <Erik.Huizer@SURFnet.nl>
  1831.    S:    Message-Id:
  1832.    S:     <Pine.3.84.9307140123.B27397-0100000@shiva2.cac.washington.edu>
  1833.    S:    Mime-Version: 1.0
  1834.    S:    Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
  1835.    S:
  1836.    S:    )
  1837.    S:    a004 OK FETCH completed
  1838.    C:    a005 store 12 +flags \deleted
  1839.    S:    * 12 FETCH (FLAGS (\Seen \Deleted))
  1840.    S:    a005 OK +FLAGS completed
  1841.    C:    a006 logout
  1842.    S:    * BYE IMAP2bis server terminating connection
  1843.    S:    a006 OK LOGOUT completed
  1844.  
  1845.  
  1846.  
  1847. Crispin                                                        [Page 33]
  1848.  
  1849. Internet Draft                  IMAP2bis                 August 13, 1993
  1850.  
  1851.  
  1852. Design Discussion
  1853.  
  1854.    IMAP2bis is a textual protocol.  The use of MIME encoding in IMAP2bis
  1855.    makes it possible to support 8-bit textual and binary mail.
  1856.  
  1857.    IMAP2bis implementations MAY transmit 8-bit characters in literals,
  1858.    but should do so only when the character set is identified.  For
  1859.    example, 8-bit characters are specifically permitted in MIME body
  1860.    parts (fetching BODY[section]) of type TEXT.  8-bit characters are
  1861.    also permitted in the argument to APPEND.
  1862.  
  1863.    For compatibility with the 7-bit world, servers MUST NOT transmit 8-
  1864.    bit characters in RFC822.HEADER fetch results, and SHOULD NOT
  1865.    transmit 8-bit characters in RFC822.TEXT (and by extension RFC822)
  1866.    fetch results.
  1867.  
  1868.    Because 8-bit characters are permitted in the argument to APPEND, a
  1869.    server in the 7-bit world MUST, if it implements the APPEND command,
  1870.    be able to make a reversible conversion of the 8-bit APPEND data to
  1871.    7-bit data using MIME.
  1872.  
  1873.    Although a BINARY body encoding is defined, IMAP2bis does not permit
  1874.    unencoded binary strings.  A "binary string" is any string with NUL
  1875.    characters; a string with an excessive number of CTL characters may
  1876.    also be considered to be binary.  The mixing of unencoded binary in
  1877.    the same stream as textual commands would make the protocol more
  1878.    vulnerable to synchronization problems.  Implementations MUST encode
  1879.    binary data into BASE64 prior to transmitting it with IMAP2bis.
  1880.  
  1881.    When operating in the online model, an IMAP2bis client should
  1882.    maintain a local cache of data from the mailbox.  This cache is an
  1883.    incomplete model of the mailbox, and at startup is generally empty.
  1884.    As the client processes all unsolicited data, it updates the cache
  1885.    based on this data.  When a tagged response arrives, the client's
  1886.    cache has been updated from the associated request.
  1887.  
  1888.    Note that a server can send data that the client did not request,
  1889.    such as mailbox size or flag updates.  A server MUST send mailbox
  1890.    size updates automatically in the course of processing a command.  A
  1891.    server SHOULD send message flag updates automatically, without
  1892.    requiring the client to request such updates explicitly.
  1893.  
  1894.    Regardless of what implementation decisions a client may take on
  1895.    caching, a client MUST record EXISTS and RECENT updates and MUST NOT
  1896.    assume that a CHECK or NOOP command will return EXISTS or RECENT
  1897.    information.
  1898.  
  1899.    Although it is permitted for a server to send an unsolicited response
  1900.  
  1901.  
  1902.  
  1903. Crispin                                                        [Page 34]
  1904.  
  1905. Internet Draft                  IMAP2bis                 August 13, 1993
  1906.  
  1907.  
  1908.    while there is no command in progress, this practice SHOULD NOT be
  1909.    followed due to flow control considerations.  It can cause an
  1910.    incautious implementation to deadlock.  A deadlock is avoided if
  1911.    either of the following conditions are true: (1) with the exception
  1912.    of the greeting, the server never sends responses while there is no
  1913.    command in progress; (2) the client always reads responses from the
  1914.    IMAP2bis connection regardless of whether or not a command is in
  1915.    progress (or even if it is transmitting the command).  The latter
  1916.    condition generally requires a multi-threading client implementation,
  1917.    which may not always be feasible.
  1918.  
  1919.    If a server has an inactivity autologout timer, that timer MUST be of
  1920.    at least 30 minutes' duration.  The receipt of a NOOP command from
  1921.    the client during that interval should suffice to reset the
  1922.    autologout timer.  Periodic transmission of a NOOP from the client
  1923.    during periods of inactivity also has the benefit of avoiding the
  1924.    possible deadlock noted above, or even act as a poll for updates.
  1925.  
  1926.    It is frequently asked why there is no message posting capabilities
  1927.    in IMAP2bis.  Message posting is orthogonal to the scope of a mail
  1928.    access protocol and detracts from its primary focus.  SMTP (RFC 821)
  1929.    provides the minimal functionality needed for message posting without
  1930.    losing valuable capabilities (such as blind carbon copies).  Any
  1931.    message posting capability in IMAP2bis would need, at a minimum, to
  1932.    provide equivalent capabilities.
  1933.  
  1934.    At the time of the writing of this document, an extensive set of
  1935.    extensions to SMTP is in the Internet standards process.  Should
  1936.    those extensions become an Internet Standard it would be necessary to
  1937.    revise IMAP2bis again to provide corresponding capabilities, if a
  1938.    message posting facility was included in IMAP2bis.  In other words, a
  1939.    duplication of effort would be required each time a change is made to
  1940.    message transport technology.
  1941.  
  1942.    Another undesirable aspect of message posting in IMAP2bis occurs when
  1943.    a (very) remote server is used.  It is unlikely that a client will
  1944.    support multiple means of posting a message; it adds excessive size
  1945.    and complexity which can not be afforded, particularly on smaller
  1946.    machines.  Consider a client connecting to an IMAP2bis server over an
  1947.    interactive satellite link to a foreign country.  A local message
  1948.    posting (SMTP) server is available which uses a lower-cost batched
  1949.    link.  In this case, the use of the interactive link would be
  1950.    wasteful and costly.
  1951.  
  1952.    Message posting to IMAP2bis has been suggested as a means of
  1953.    authenticating postings.  The problem is that access authentication
  1954.    credentials are not necessarily the same as posting authentication
  1955.    credentials.  At some sites, the disclosure of a portion of access
  1956.  
  1957.  
  1958.  
  1959. Crispin                                                        [Page 35]
  1960.  
  1961. Internet Draft                  IMAP2bis                 August 13, 1993
  1962.  
  1963.  
  1964.    authentication credentials in a mail message (as a "From" or "Sender"
  1965.    address) may be a serious security breach of greater significance
  1966.    than forged mail.
  1967.  
  1968.    The Internet message transport infrastructure has no concept of
  1969.    authentication credentials, and neither authentication syntax nor
  1970.    semantics are transferred within a message.  As a result, any attempt
  1971.    at authenticating a message via posting authenticaton is completely
  1972.    ineffective once the message leaves the authenticating server; any
  1973.    indication of authentication in the message can easily be reproduced
  1974.    further down the line.  It is for this reason that public-key based
  1975.    message authentication systems such as Privacy Enhanced Mail are
  1976.    presently under development.
  1977.  
  1978.    IMAP2bis does not address problems with multiple IMAP2bis servers at
  1979.    a single site, access control lists, and mobility of client
  1980.    configuration and address book information.  These and other issues
  1981.    are being considered for a companion protocol (Interactive Mail
  1982.    Support Protocol) being developed at CMU.
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015. Crispin                                                        [Page 36]
  2016.  
  2017. Internet Draft                  IMAP2bis                 August 13, 1993
  2018.  
  2019.  
  2020. Formal Syntax
  2021.  
  2022.    The following syntax specification uses the augmented Backus-Naur
  2023.    Form (BNF) notation as specified in RFC 822 with one exception; the
  2024.    delimiter used with the "#" construct is a single space (SPACE) and
  2025.    not a comma.
  2026.  
  2027.    Except as noted otherwise, all alphabetic characters in the IMAP2bis
  2028.    protocol are case-insensitive.  For example, "LOGIN", "login" and
  2029.    "lOgIn" are all valid as the login command.
  2030.  
  2031.    Syntax marked as obsolete may be encountered with implementations
  2032.    written for an older version of this specification.  New
  2033.    implementations SHOULD accept obsolete syntax as input, but MUST NOT
  2034.    otherwise use it.
  2035.  
  2036.    address         ::= "(" addr_name SPACE addr_adl SPACE addr_mailbox
  2037.                        SPACE addr_host ")"
  2038.  
  2039.    addr_adl        ::= nil / string
  2040.  
  2041.    addr_host       ::= nil / string
  2042.  
  2043.    addr_mailbox    ::= nil / string
  2044.  
  2045.    addr_name       ::= nil / string
  2046.  
  2047.    append          ::= "APPEND" SPACE mailbox SPACE string
  2048.  
  2049.    astring         ::= atom / string
  2050.  
  2051.    atom            ::= 1*<any CHAR except specials, SPACE, and CTLs>
  2052.  
  2053.    bboard          ::= "BBOARD" SPACE mailbox_bboard
  2054.  
  2055.    body            ::= "(" body_structure ")"
  2056.  
  2057.    body_basic      ::= body_type SPACE body_subtype SPACE body_parameter
  2058.                        SPACE body_id SPACE body_description SPACE
  2059.                        body_encoding SPACE body_size_byte
  2060.  
  2061.    body_description::= nil / string
  2062.  
  2063.    body_encoding   ::= "7BIT" / "8BIT" / "BINARY" / "BASE64"/
  2064.                        "QUOTEDPRINTABLE" / atom
  2065.  
  2066.    body_id         ::= nil / string
  2067.  
  2068.  
  2069.  
  2070.  
  2071. Crispin                                                        [Page 37]
  2072.  
  2073. Internet Draft                  IMAP2bis                 August 13, 1993
  2074.  
  2075.  
  2076.    body_msg        ::= body_basic SPACE envelope SPACE body
  2077.  
  2078.    body_parameter  ::= nil / "(" 1#(string string) ")"
  2079.  
  2080.    body_section    ::= number / number "." body_section
  2081.  
  2082.    body_size_byte  ::= number
  2083.  
  2084.    body_size_line  ::= number
  2085.  
  2086.    body_structure  ::= body_basic / body_msg / body_text /
  2087.                        "(" body_structure ")" SPACE body_subtype
  2088.  
  2089.    body_subtype    ::= nil / string
  2090.  
  2091.    body_text       ::= body_basic SPACE body_size_line
  2092.  
  2093.    body_type       ::= "TEXT" / "MULTIPART" / "MESSAGE" / "APPLICATION" /
  2094.                        "AUDIO" / "IMAGE" / "VIDEO" / atom
  2095.  
  2096.    CHAR            ::= <any 7-bit US-ASCII character except NUL, 0x01 - 0x7f>
  2097.  
  2098.    CHAR8           ::= <any 8-bit octet except NUL, 0x01 - 0xff>
  2099.  
  2100.    check           ::= "CHECK"
  2101.  
  2102.    copy            ::= "COPY" SPACE sequence SPACE mailbox
  2103.  
  2104.    CR              ::= <ASCII CR, carriage return, 0x0C>
  2105.  
  2106.    create          ::= "CREATE" SPACE mailbox
  2107.  
  2108.    CRLF            ::= CR LF
  2109.  
  2110.    CTL             ::= <any ASCII control character and DEL, 0x00 - 0x1f,
  2111. 0x7f>
  2112.  
  2113.    date            ::= date_new / date_old
  2114.  
  2115.    date_day        ::= 1*2DIGIT
  2116.                        ;; day of month
  2117.  
  2118.    date_month      ::= "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" /
  2119.                        "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"
  2120.  
  2121.    date_new        ::= date_day "-" date_month "-" date_year
  2122.  
  2123.    date_old        ::= date_day "-" date_month "-" date_year_old
  2124.                        ;; Obsolete
  2125.  
  2126.  
  2127.  
  2128. Crispin                                                        [Page 38]
  2129.  
  2130. Internet Draft                  IMAP2bis                 August 13, 1993
  2131.  
  2132.  
  2133.    date_year       ::= 4DIGIT / date_year_old
  2134.  
  2135.    date_year_old   ::= 2DIGIT
  2136.                        ;; Obsolete, (year - 1900)
  2137.  
  2138.    date_time       ::= date_time_new / date_time_old
  2139.  
  2140.    date_time_new   ::= date_new SPACE time SPACE zone
  2141.  
  2142.    date_time_old   ::= date_old SPACE time "-" zone_old
  2143.                        ;; Obsolete
  2144.  
  2145.    delete          ::= "DELETE" SPACE mailbox_other
  2146.  
  2147.    DIGIT           ::= <any ASCII decimal digit, 0x30 - 0x39>
  2148.  
  2149.    DIGIT_HEX       :: DIGIT / "a" / "b" / "c" / "d" / "e" / "f"
  2150.  
  2151.    envelope        ::= "(" env_date SPACE env_subject SPACE env_from SPACE
  2152.                        env_sender SPACE env_reply-to SPACE env_to SPACE
  2153.                        env_cc SPACE env_bcc SPACE env_in-reply-to SPACE
  2154.                        env_message-id ")"
  2155.  
  2156.    env_bcc         ::= nil / "(" 1*address ")"
  2157.  
  2158.    env_cc          ::= nil / "(" 1*address ")"
  2159.  
  2160.    env_date        ::= string
  2161.  
  2162.    env_from        ::= nil / "(" 1*address ")"
  2163.  
  2164.    env_in-reply-to ::= nil / string
  2165.  
  2166.    env_message-id  ::= nil / string
  2167.  
  2168.    env_reply-to    ::= nil / "(" 1*address ")"
  2169.  
  2170.    env_sender      ::= nil / "(" 1*address ")"
  2171.  
  2172.    env_subject     ::= nil / string
  2173.  
  2174.    env_to          ::= nil / "(" 1*address ")"
  2175.  
  2176.    examine         ::= "EXAMINE" SPACE mailbox
  2177.  
  2178.    expunge         ::= "EXPUNGE"
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184. Crispin                                                        [Page 39]
  2185.  
  2186. Internet Draft                  IMAP2bis                 August 13, 1993
  2187.  
  2188.  
  2189.    fetch           ::= "FETCH" SPACE sequence SPACE ("ALL" / "FULL" /
  2190.                        "FAST" / fetch_att / "(" 1#fetch_att ")")
  2191.  
  2192.    fetch_att       ::= fetch_att_other / fetch_att_text
  2193.  
  2194.    fetch_att_other ::= "BODY" / "ENVELOPE" / "FLAGS" / "INTERNALDATE" /
  2195.                        "RFC822.SIZE" / "UID"
  2196.  
  2197.    fetch_att_text  ::= "BODY[" body_section "]" / "RFC822" /
  2198.                        "RFC822.HEADER" /
  2199.                        "RFC822.HEADER.LINES" SPACE header_line_list /
  2200.                        "RFC822.HEADER.LINES.NOT" SPACE header_line_list /
  2201.                        "RFC822.TEXT"
  2202.  
  2203.    find            ::= find_mailbox / find_bboard
  2204.  
  2205.    find_bboard     ::= find_bboards / find_boards_all
  2206.  
  2207.    find_bboards    ::= "FIND" SPACE "BBOARDS" SPACE find_pattern
  2208.  
  2209.    find_bboards_all
  2210.                    ::= "FIND" SPACE "ALL.BBOARDS" SPACE find_pattern
  2211.  
  2212.    find_mailbox    ::= find_mailboxes / find_mailboxes_all
  2213.  
  2214.    find_mailboxes  ::= "FIND" SPACE "MAILBOXES" SPACE find_pattern
  2215.  
  2216.    find_mailboxes_all
  2217.                    ::= "FIND" SPACE "ALL.MAILBOXES" SPACE find_pattern
  2218.  
  2219.    find_pattern    ::= astring
  2220.                        ;; includes find_wildcards
  2221.  
  2222.    find_wildcards  ::= "%" / "?" / "*"
  2223.  
  2224.    flag            ::= user_flag / system_flag
  2225.  
  2226.    flag_list       ::= "(" 1#flag ")"
  2227.  
  2228.    flags           ::= 1#flag / flag_list
  2229.  
  2230.    greeting        ::= "*" SPACE (human_data / "PREAUTH" SPACE response_text)
  2231.  
  2232.    header_line     ::= string
  2233.  
  2234.    header_line_list ::= "(" 1#header_line ")"
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240. Crispin                                                        [Page 40]
  2241.  
  2242. Internet Draft                  IMAP2bis                 August 13, 1993
  2243.  
  2244.  
  2245.    human_data      ::= "OK" SPACE response_text / "NO" SPACE response_text /
  2246.                        "BAD" SPACE response_text / "BYE" SPACE resonse_text
  2247.  
  2248.    inbox           ::= "INBOX"
  2249.                        ;; case-independent, but SHOULD be upper-case
  2250.  
  2251.    istring         ::= astring
  2252.                        ;; possible RFC 1342 format data
  2253.  
  2254.    kerberos_authenticator
  2255.                    ::= 1*DIGIT_HEX
  2256.  
  2257.    kerberos_response
  2258.                    ::= 1*DIGIT_HEX
  2259.  
  2260.    LF              ::= <ASCII LF, line feed, 0x0A>
  2261.  
  2262.    literal         ::= "{" number "}" CRLF 1*CHAR8
  2263.                        ;; The number represents the number of CHAR8 octets.
  2264.  
  2265.    login           ::= "LOGIN" SPACE userid SPACE password
  2266.  
  2267.    logout          ::= "LOGOUT"
  2268.  
  2269.    mailbox         ::= inbox / mailbox_other
  2270.  
  2271.    mailbox_bboard  ::= astring
  2272.                        ;; May not be INBOX (in any case).  Should not
  2273.                        ;; include find_wildcards.  May be case-dependent
  2274.                        ;; as a function of server implementation.  May
  2275.                        ;; be a different namespace from mailbox_other.
  2276.  
  2277.    mailbox_other   ::= astring
  2278.                        ;; May not be INBOX (in any case).  Should not
  2279.                        ;; include find_wildcards.  May be case-dependent
  2280.                        ;; as a function of server implementation
  2281.  
  2282.    mailbox_data    ::= "MAILBOX" SPACE mstring / "BBOARD" SPACE mstring /
  2283.                         "SEARCH" SPACE 1#number / "FLAGS" SPACE flag_list
  2284.  
  2285.    message_data    ::= number SPACE (msg_exists / msg_recent / msg_expunge /
  2286.                        msg_fetch / msg_obsolete)
  2287.  
  2288.    msg_copy        ::= "COPY"
  2289.                        ;; Obsolete
  2290.  
  2291.    msg_exists      ::= "EXISTS"
  2292.  
  2293.  
  2294.  
  2295.  
  2296. Crispin                                                        [Page 41]
  2297.  
  2298. Internet Draft                  IMAP2bis                 August 13, 1993
  2299.  
  2300.  
  2301.    msg_expunge     ::= "EXPUNGE"
  2302.  
  2303.    msg_fetch       ::= "FETCH" SPACE "(" 1#("BODY" SPACE body /
  2304.                        "BODY[" body_section "]" string /
  2305.                        "ENVELOPE" SPACE envelope /
  2306.                        "FLAGS" SPACE "(" 1#(recent_flag / flag) ")" /
  2307.                        "INTERNALDATE" SPACE date_time /
  2308.                        "RFC822" SPACE string /
  2309.                        "RFC822.HEADER" SPACE string /
  2310.                        "RFC822.SIZE" SPACE number /
  2311.                        "RFC822.TEXT" SPACE string /
  2312.                        "UID" SPACE uniqueid) ")"
  2313.  
  2314.    msg_obsolete    ::= msg_copy / msg_store
  2315.                        ;; Obsolete unsolicited data responses
  2316.  
  2317.    msg_recent      ::= "RECENT"
  2318.  
  2319.    msg_store       ::= "STORE" SPACE "(" 1#("FLAGS" SPACE
  2320.                        "(" 1#(recent_flag / flag) "))"
  2321.                        ;; Obsolete
  2322.  
  2323.    mstring         ::= text_line
  2324.                        ;; Represents a mailbox
  2325.  
  2326.    nil             ::= "NIL"
  2327.  
  2328.    noop            ::= "NOOP"
  2329.  
  2330.    number          ::= 1*DIGIT
  2331.  
  2332.    partial         ::= "PARTIAL" SPACE number SPACE fetch_att_text SPACE
  2333.                        number SPACE number
  2334.  
  2335.    password        ::= astring / "@KERBEROS:" kerberos_authenticator
  2336.  
  2337.    QCHAR           ::= <any CHAR except qspecials, CR, and LF>
  2338.  
  2339.    qspecials       ::= <"> / "%" / "\"
  2340.  
  2341.    quoted_string   ::= <"> *QCHAR <">
  2342.  
  2343.    recent_flag     ::= "\RECENT"
  2344.  
  2345.    ready           ::= "+" SPACE response_text
  2346.  
  2347.    rename          ::= "RENAME" SPACE mailbox SPACE mailbox_other
  2348.  
  2349.  
  2350.  
  2351.  
  2352. Crispin                                                        [Page 42]
  2353.  
  2354. Internet Draft                  IMAP2bis                 August 13, 1993
  2355.  
  2356.  
  2357.    request         ::= tag SPACE (noop / login / logout / create /
  2358.                        delete / rename / find / subscribe / unsubscribe /
  2359.                        select / examine / bboard / check / expunge /
  2360.                        copy / append / fetch / partial / store / uid /
  2361.                        search / x_command ) CRLF
  2362.  
  2363.    response        ::= tag SPACE ("OK" / "NO" / "BAD") SPACE response_text
  2364. CRLF
  2365.  
  2366.    response_code   ::= "PARSE" / "READ-ONLY" / "READ-WRITE" / "TRYCREATE" /
  2367.                        "X" atom / kerberos_response
  2368.  
  2369.    response_text   ::= ("[" response_code "]" text_line) / text_line
  2370.  
  2371.    search          ::= "SEARCH" SPACE 1#("ALL" / "ANSWERED" /
  2372.                        "BCC" SPACE istring / "BEFORE" SPACE day /
  2373.                        "BODY" SPACE istring / "CC" SPACE istring / "DELETED" /
  2374.                        "FLAGGED" / "KEYWORD" SPACE atom / "NEW" / "OLD" /
  2375.                        "ON" SPACE day / "RECENT" / "SEEN" /
  2376.                        "SINCE" SPACE day / "TEXT" SPACE istring /
  2377.                        "TO" SPACE istring / "UNANSWERED" / "UNDELETED" /
  2378.                        "UNFLAGGED" / "UNKEYWORD" / "UNSEEN")
  2379.  
  2380.    select          ::= "SELECT" SPACE mailbox
  2381.  
  2382.    sequence        ::= number / (sequence "," sequence) / (number ":" number)
  2383.                        ;; identifies a set of messages by consecutive numbers
  2384.                        ;; from 1 to the number of messages in the mailbox.
  2385.                        ;; Comma delimits individual numbers, colon delimits
  2386.                        ;; between two numbers inclusive.
  2387.                        ;; Example: 2,4:7,9,12:15 is 2,4,5,6,7,9,12,13,14,15
  2388.  
  2389.    SPACE           ::= <ASCII SP, space, 0x20>
  2390.  
  2391.    specials        ::= "{" / qspecials
  2392.  
  2393.    store           ::= "STORE" SPACE sequence SPACE store_att
  2394.  
  2395.    store_att       ::= "+FLAGS" SPACE flags / "-FLAGS" SPACE flags /
  2396.                        "FLAGS" SPACE flags
  2397.  
  2398.    string          ::= quoted_string / literal
  2399.  
  2400.    subscribe       ::= subscribe_mailbox / subscribe_bboard
  2401.  
  2402.    subscribe_bboard
  2403.                    ::= "SUBSCRIBE" SPACE "BBOARD" SPACE mailbox_bboard
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409. Crispin                                                        [Page 43]
  2410.  
  2411. Internet Draft                  IMAP2bis                 August 13, 1993
  2412.  
  2413.  
  2414.    subscribe_mailbox
  2415.                    ::= "SUBSCRIBE" SPACE "MAILBOX" SPACE mailbox
  2416.  
  2417.    system_flag     ::= "\ANSWERED" / "\FLAGGED" / "\DELETED" / "\SEEN"
  2418.  
  2419.    tag             ::= atom
  2420.  
  2421.    text_line       ::= 1*<any CHAR except CR and LF>
  2422.  
  2423.    time            ::= 2DIGIT ":" 2DIGIT ":" 2DIGIT
  2424.                        ;; hours minutes seconds
  2425.  
  2426.    uid             ::= "UID" SPACE (uid_after / uid_before / copy /
  2427.                        fetch / store)
  2428.                        ;; uniqueids used instead of message numbers
  2429.  
  2430.    uid_after       ::= "AFTER" SPACE uniqueid
  2431.  
  2432.    uid_before      ::= "BEFORE" SPACE uniqueid
  2433.  
  2434.    uniqueid        ::= number
  2435.                        ;;; strictly ascending
  2436.  
  2437.    unsolicited     ::= "*" SPACE (human_data / mailbox_data /
  2438.                        message_data) CRLF
  2439.  
  2440.    unsubscribe     ::= unsubscribe_mailbox / unsubscribe_bboard
  2441.  
  2442.    unsubscribe_bboard
  2443.                    ::= "UNSUBSCRIBE" SPACE "BBOARD" SPACE mailbox_bboard
  2444.  
  2445.    unsubscribe_mailbox
  2446.                    ::= "UNSUBSCRIBE" SPACE "MAILBOX" SPACE mailbox_mailbox
  2447.  
  2448.    userid          ::= astring
  2449.  
  2450.    user_flag       ::= atom
  2451.  
  2452.    x_command       ::= "X" atom <optional arguments>
  2453.                        ;; experimental expansion commands
  2454.  
  2455.    zone            ::= ("+" / "-") 4DIGIT
  2456.                        ;; Signed four-digit value of hhmm representing
  2457.                        ;; hours and minutes west of Greenwich (that is,
  2458.                        ;; (the amount that the given time differs from
  2459.                        ;; Universal Time).  Subtracting the timezone
  2460.                        ;; from the given time will give the UT form.
  2461.                        ;; The Universal Time zone is "+0000".
  2462.  
  2463.  
  2464.  
  2465. Crispin                                                        [Page 44]
  2466.  
  2467. Internet Draft                  IMAP2bis                 August 13, 1993
  2468.  
  2469.  
  2470.    zone_old        ::= "UT" / "GMT" / "Z" /                ;; +0000
  2471.                        "AST" / "EST" / "CST" / "MST" /     ;; -0400 to -0700
  2472.                        "PST" / "YST" / "HST" / "BST" /     ;; -0800 to -1100
  2473.                        "ADT" / "EDT" / "CDT" / "MDT" /     ;; -0300 to -0600
  2474.                        "PDT" / "YDT" / "HDT" / "BDT" /     ;; -0700 to -1000
  2475.                        "A" / "B" / "C" / "D" / "E" / "F" / ;; +0100 to +0600
  2476.                        "G" / "H" / "I" / "K" / "L" / "M" / ;; +0700 to +1200
  2477.                        "N" / "O" / "P" / "Q" / "R" / "S" / ;; -0100 to -0600
  2478.                        "T" / "U" / "V" / "W" / "X" / "Y"   ;; -0700 to -1200
  2479.                        ;; Obsolete
  2480.  
  2481.    A protocol session is as follows:
  2482.  
  2483.     Server: greeting
  2484.     *<Client: request (first part, if it contains a literal)
  2485.       *<Server: ready
  2486.         Client: request (next part)
  2487.        >
  2488.       Server: *<unsolicited>
  2489.       Server: response
  2490.      >
  2491.  
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521. Crispin                                                        [Page 45]
  2522.  
  2523. Internet Draft                  IMAP2bis                 August 13, 1993
  2524.  
  2525.  
  2526. Acknowledgements
  2527.  
  2528.    Bill Yeager and Rich Acuff contributed invaluable suggestions in the
  2529.    evolution of IMAP2 from the original IMAP.  James Rice pointed out
  2530.    several ambiguities in the previous IMAP2 specification.
  2531.  
  2532.    My colleagues on the Pine team -- Steve Hubert, Laurence Lundblade,
  2533.    David Miller, and Mike Seibel -- worked long and hard to create a
  2534.    fantastic email user agent with worldwide popularity.  Without their
  2535.    efforts, IMAP2 would have languished in obscurity.  Terry Gray, our
  2536.    boss, provided much-needed moral support and guidance, while refusing
  2537.    to let us get away with "good enough" when "great" was possible.
  2538.  
  2539.    The present protocol would not have come into existance without the
  2540.    assistance of the IETF IMAP2 working group, and in particular Ned
  2541.    Freed, John Myers, Chris Newman, and Adam Treister.
  2542.  
  2543.    Any mistakes, flaws, or sins of omission in this IMAP2bis protocol
  2544.    specification are, however, strictly my own; and the mention of any
  2545.    name above does not imply an endorsement.
  2546.  
  2547. Security Considerations
  2548.  
  2549.    Security issues are discussed in this memo only as far as
  2550.    authentication for the purpose of accessing a server are concerned.
  2551.  
  2552. Author's Address
  2553.  
  2554.    Mark R. Crispin
  2555.    Networks and Distributed Computing, JE-30
  2556.    University of Washington
  2557.    Seattle, WA  98195
  2558.  
  2559.    Phone: (206) 543-5762
  2560.  
  2561.    EMail: MRC@CAC.Washington.EDU
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577. Crispin                                                        [Page 46]
  2578.  
  2579.  
  2580.